Obtaining specific objects by using their JDO Identity or obtaining a collection of objects through the use of an Extent is simple and convenient. However, both these techniques have drawbacks. It is not always possible or desirable to do the following:
Store the JDO identity of an object.
Iterate through potentially large collections of object graphs to locate a few objects that might be useful to the application. For example, if the previous snippet were applied to Stock objects that had a symbol attribute, the application would need to iterate through all the Stocks and compare the symbol until it found the one it was interested in!
The API portion of the query facility in JDO consists primarily ...