Use of the XPath API for querying provides "in-datastore" handling for a subset of the JDOQL/JPQL operations rather than having to load all into memory. See http://www.ibm.com/developerworks/library/x-javaxpathapi.html