Subqueries (nested queries) have been added to JDOQL (JDO Query Language) in JDO 2.1.

This is the main feature of JDO 2.0-2.1-2.2 that is not implemented yet in ObjectDB 2.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)