6.3. Finding Objects with the Query Facility
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 ...
Get Core Java™ Data Objects now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.