Top Fields Constructors Methods
org.hibernate.query.spi

public abstract Class AbstractQuery<R>

extends AbstractSelectionQuery<R>
implements QueryImplementor<R>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.spi.QueryImplementor, org.hibernate.query.Query, jakarta.persistence.TypedQuery, jakarta.persistence.Query, org.hibernate.query.MutationQuery, org.hibernate.query.CommonQueryContract, org.hibernate.query.SelectionQuery
Known Direct Subclasses
org.hibernate.query.sql.internal.NativeQueryImpl, org.hibernate.procedure.internal.ProcedureCallImpl
Imports
java.io.Serializable, java.time.Instant, java.util.Calendar, .Collection, .Date, .HashSet, .List, .Map, .Set, jakarta.persistence.CacheRetrieveMode, .CacheStoreMode, .EntityGraph, .FlushModeType, .LockModeType, .Parameter, .TemporalType, org.hibernate.CacheMode, .FlushMode, .HibernateException, .LockMode, .LockOptions, .TypeMismatchException, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.graph.GraphSemantic, org.hibernate.internal.EntityManagerMessageLogger, .HEMLogging, org.hibernate.jpa.AvailableHints, org.hibernate.jpa.internal.util.FlushModeTypeHelper, .LockModeTypeHelper, org.hibernate.query.BindableType, .IllegalQueryOperationException, .Order, .Query, .QueryParameter, .ResultListTransformer, .TupleTransformer, org.hibernate.query.named.NamedQueryMemento

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
protected static final EntityManagerMessageLogger
Inherited from org.hibernate.query.spi.AbstractSelectionQuery:
CRITERIA_HQL_STRING

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public QueryImplementor<R>
addQueryHint(String
The database specific query hint to add.
hint
)

Implements org.hibernate.query.Query.addQueryHint.

Add a database query hint to the SQL query.
protected void
protected void
public QueryImplementor<R>
protected abstract int
public QueryImplementor<R>
public int
executeUpdate()

Implements org.hibernate.query.Query.executeUpdate.

Execute an insert, update, or delete statement, and return the number of affected entities.
public String
public int
public FlushModeType
public LockModeType
public LockOptions
public int
public Set<Parameter<?>>
getParameters()

Overrides org.hibernate.query.spi.AbstractCommonQueryContract.getParameters.

Implements jakarta.persistence.Query.getParameters.

Get the parameter objects corresponding to the declared parameters of the query.
public MutableQueryOptions
public Set<String>
public boolean
isCacheable()

Overrides org.hibernate.query.spi.AbstractSelectionQuery.isCacheable.

Implements org.hibernate.query.SelectionQuery.isCacheable.

Should the results of the query be stored in the second level cache?
protected void
protected boolean
public QueryImplementor<R>
setCacheable(boolean cacheable)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setCacheable.

Implements org.hibernate.query.Query.setCacheable, org.hibernate.query.SelectionQuery.setCacheable.

Enable/disable second level query (result) caching for this query.
public QueryImplementor<R>
public QueryImplementor<R>
setCacheRegion(String cacheRegion)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setCacheRegion.

Implements org.hibernate.query.Query.setCacheRegion, org.hibernate.query.SelectionQuery.setCacheRegion.

Set the name of the cache region where query results should be cached (assuming isCacheable).
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
setFetchSize(int
the fetch size hint
fetchSize
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setFetchSize.

Implements org.hibernate.query.Query.setFetchSize, org.hibernate.query.SelectionQuery.setFetchSize.

Sets a JDBC fetch size hint for the query.
public QueryImplementor<R>
setFirstResult(int
position of the first result, numbered from 0
startPosition
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setFirstResult.

Implements org.hibernate.query.Query.setFirstResult, org.hibernate.query.SelectionQuery.setFirstResult.

Set the first row position to return from the query results.
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
setHint(String
name of property or hint
hintName
,
Object
value for the property or hint
value
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setHint.

Implements org.hibernate.query.Query.setHint, org.hibernate.query.SelectionQuery.setHint, org.hibernate.query.CommonQueryContract.setHint.

Set a query property or hint.
public QueryImplementor<R>
setLockMode(String
A query alias
alias
,
LockMode
The lock mode to apply
lockMode
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setLockMode.

Implements org.hibernate.query.Query.setLockMode, org.hibernate.query.SelectionQuery.setLockMode.

Set the LockMode to use for particular alias defined in the FROM clause of the query.
public QueryImplementor<R>
public QueryImplementor<R>
setLockOptions(LockOptions
The lock options to apply to the query.
lockOptions
)

Implements org.hibernate.query.Query.setLockOptions.

Apply the given lock options to this query.
public QueryImplementor<R>
setMaxResults(int
maximum number of results to retrieve
maxResult
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setMaxResults.

Implements org.hibernate.query.Query.setMaxResults, org.hibernate.query.SelectionQuery.setMaxResults.

Set the max number of rows requested for the query results.
public void
public void
public void
public Query<R>
setOrder(List<Order<? super R>>
one or more instances of Order
orders
)

Implements org.hibernate.query.Query.setOrder, org.hibernate.query.SelectionQuery.setOrder.

If the result type of this query is an entity class, add one or more rules for ordering the query results.
public Query<R>
setOrder(Order<? super R>
an instance of Order
order
)

Implements org.hibernate.query.Query.setOrder, org.hibernate.query.SelectionQuery.setOrder.

If the result type of this query is an entity class, add a rule for ordering the query results.
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameter(String name, P value, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameter.

Implements org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.SelectionQuery.setParameter, org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameter(int position, P value, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameter.

Implements org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.SelectionQuery.setParameter, org.hibernate.query.CommonQueryContract.setParameter.

Bind the given argument to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
value
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameter.

Implements org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.SelectionQuery.setParameter, org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter.
public <P> QueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
value
,
Class<P>
a BindableType representing the type of the parameter
javaTypeClass
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameter.

Implements org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.SelectionQuery.setParameter, org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
setParameter(QueryParameter<P>
the query parameter memento
parameter
,
P
the argument, which might be null
value
,
BindableType<P>
an BindableType representing the type of the parameter
type
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameter.

Implements org.hibernate.query.spi.QueryImplementor.setParameter, org.hibernate.query.SelectionQuery.setParameter, org.hibernate.query.CommonQueryContract.setParameter.

Bind an argument to the query parameter represented by the given QueryParameter using the given BindableType.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(String name, Collection<? extends P> values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(String name, P[] values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(int position, Collection<? extends P> values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(int position, P[] values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to an ordinal query parameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public <P> QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public <P> QueryImplementor<R>
public <P> QueryImplementor<R>
setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaTypeClass)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setParameterList.

Implements org.hibernate.query.spi.QueryImplementor.setParameterList, org.hibernate.query.SelectionQuery.setParameterList, org.hibernate.query.CommonQueryContract.setParameterList.

Bind multiple arguments to the query parameter represented by the given QueryParameter using the given Class reference to attempt to determine the BindableType to use.
public <P> QueryImplementor<R>
public QueryImplementor<R>
setProperties(Object
any JavaBean or POJO
bean
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setProperties.

Implements org.hibernate.query.spi.QueryImplementor.setProperties, org.hibernate.query.SelectionQuery.setProperties, org.hibernate.query.CommonQueryContract.setProperties.

Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.
public QueryImplementor<R>
setProperties(Map<K, V>
a Map of names to arguments
map
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setProperties.

Implements org.hibernate.query.spi.QueryImplementor.setProperties, org.hibernate.query.SelectionQuery.setProperties, org.hibernate.query.CommonQueryContract.setProperties.

Bind the values of the given Map for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.
public QueryImplementor<R>
setQueryPlanCacheable(boolean queryPlanCacheable)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setQueryPlanCacheable.

Implements org.hibernate.query.SelectionQuery.setQueryPlanCacheable.

Enable/disable query plan caching for this query.
public QueryImplementor<R>
setReadOnly(boolean
true indicates that entities and proxies loaded by the query are to be put in read-only mode; false indicates that entities and proxies loaded by the query will be put in modifiable mode
readOnly
)

Overrides org.hibernate.query.spi.AbstractSelectionQuery.setReadOnly.

Implements org.hibernate.query.Query.setReadOnly, org.hibernate.query.SelectionQuery.setReadOnly.

Set the read-only/modifiable mode for entities and proxies loaded by this Query.
public QueryImplementor<R>
public QueryImplementor<R>
public <T> QueryImplementor<T>
Inherited from org.hibernate.query.spi.AbstractSelectionQuery:
afterQueryafterQueryafterQueryHandlingFetchProfilesapplyOptionsbeforeQuerybeforeQueryHandlingFetchProfilesbuildTupleMetadatacheckQueryReturnTypedoListdoScrollgetCacheModegetCacheRegiongetCacheRetrieveModegetCacheStoreModegetCallbackgetFetchSizegetHibernateLockModegetQueryStringgetResultStreamgetSessionFactorygetSingleResultgetSingleResultOrNullhasAppliedGraphhasCallbackActionshasLimitisQueryPlanCacheableisReadOnlylistrequiresTxnresetCallbackscrollscrollsetAliasSpecificLockModesetFollowOnLockingsetHibernateLockModestreamuniqueElementuniqueResultuniqueResultOptionalverifyResultTypevisitQueryReturnType