8.3. Query interface

The object returned from the query factory methods of a persistence manager is an instance of the Query interface. The UML for the Query interface is shown in Figure 8.1.

Figure 8.1. UML for Query interface

I will describe each of the Query interface’s methods briefly before we look at our first JDOQL examples.

					PersistenceManager getPersistenceManager()
				

Returns a reference to the persistence manager with which the query is associated.

					void setClass()
				

Sets the candidate class for the query.

					void setCandidates(Collection candidateCollection)
				

Sets the candidate collection for the query.

					void setCandidates(Extent candidateExtent) ...

Get 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.