8.2. Constructing queries

A persistence manager acts as the factory for queries, and provides a set of newQuery() methods by which an application can construct queries. These methods are detailed below.

					Query newQuery()
				

Constructs a new query instance, bound to the current persistence manager. All of the query’s properties can then be set directly, including the query language.

					Query newQuery(Object query)
				

Constructs a query instance from another query. The new query shares the original query’s elements except for the candidate collection or extent. The new query is bound to the persistence manager on which newQuery() was executed, even though the original query may have been obtained from a different persistence manager. This, combined with ...

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.