Uses of Interface
jakarta.persistence.Query
Package
Description
Jakarta Persistence is the API for the management for persistence and object/relational mapping.
-
Uses of Query in jakarta.persistence
Modifier and TypeInterfaceDescriptioninterface
Interface used to control stored procedure query execution.interface
TypedQuery<X>
Interface used to control the execution of typed queries.Modifier and TypeMethodDescriptionEntityManager.createNamedQuery
(String name) Create an instance ofQuery
for executing a named query written in the Jakarta Persistence query language or in native SQL.EntityManager.createNativeQuery
(String sqlString) Create an instance ofQuery
for executing a native SQL statement, e.g., for update or delete.<T> Query
EntityManager.createNativeQuery
(String sqlString, Class<T> resultClass) Create an instance ofQuery
for executing a native SQL query.EntityManager.createNativeQuery
(String sqlString, String resultSetMapping) Create an instance ofQuery
for executing a native SQL query.EntityManager.createQuery
(CriteriaDelete<?> deleteQuery) Create an instance ofQuery
for executing a criteria delete query.EntityManager.createQuery
(CriteriaUpdate<?> updateQuery) Create an instance ofQuery
for executing a criteria update query.EntityManager.createQuery
(String qlString) Create an instance ofQuery
for executing a Jakarta Persistence query language statement.QueryTimeoutException.getQuery()
Returns the query that caused this exception.Query.setCacheRetrieveMode
(CacheRetrieveMode cacheRetrieveMode) Set the cache retrieval mode that is in effect during query execution.Query.setCacheStoreMode
(CacheStoreMode cacheStoreMode) Set the cache storage mode that is in effect during query execution.Query.setFirstResult
(int startPosition) Set the position of the first result to retrieve.Query.setFlushMode
(FlushModeType flushMode) Set the flush mode type to be used for the query execution.Set a query property or hint.Query.setLockMode
(LockModeType lockMode) Set the lock mode type to be used for the query execution.Query.setMaxResults
(int maxResult) Set the maximum number of results to retrieve.Query.setParameter
(int position, Object value) Bind an argument value to a positional parameter.Query.setParameter
(int position, Calendar value, TemporalType temporalType) Deprecated.Query.setParameter
(int position, Date value, TemporalType temporalType) Deprecated.Newly-written code should use the date/time types defined injava.time
.Query.setParameter
(Parameter<Calendar> param, Calendar value, TemporalType temporalType) Deprecated.Newly-written code should use the date/time types defined injava.time
.Query.setParameter
(Parameter<Date> param, Date value, TemporalType temporalType) Deprecated.Newly-written code should use the date/time types defined injava.time
.<T> Query
Query.setParameter
(Parameter<T> param, T value) Bind the value of aParameter
object.Query.setParameter
(String name, Object value) Bind an argument value to a named parameter.Query.setParameter
(String name, Calendar value, TemporalType temporalType) Deprecated.Newly-written code should use the date/time types defined injava.time
.Query.setParameter
(String name, Date value, TemporalType temporalType) Deprecated.Newly-written code should use the date/time types defined injava.time
.Query.setTimeout
(Integer timeout) Set the query timeout, in milliseconds.Modifier and TypeMethodDescriptionvoid
EntityManagerFactory.addNamedQuery
(String name, Query query) Define the query, typed query, or stored procedure query as a named query such that future query objects can be created from it using theEntityManager.createNamedQuery(java.lang.String)
orEntityManager.createNamedStoredProcedureQuery(java.lang.String)
methods.ModifierConstructorDescriptionQueryTimeoutException
(Query query) Constructs a newQueryTimeoutException
exception with the specified query.QueryTimeoutException
(String message, Throwable cause, Query query) Constructs a newQueryTimeoutException
exception with the specified detail message, cause, and query.
java.time
.