Interface CommonQueryContractImplementor
- All Superinterfaces:
CommonQueryContract, Query
- All Known Subinterfaces:
MutationQueryImplementor<T>, NativeQueryImplementor<R>, ProcedureCallImplementor<R>, QueryImplementor<T>, SelectionQueryImplementor<R>
-
Method Summary
Modifier and TypeMethodDescriptionaddQueryHint(String hint) Add a database query hint to the SQL query.Casts this query as a mutation query.Casts this query as aSelectionQuery.<X> SelectionQueryImplementor<X> asSelectionQuery(EntityGraph<X> entityGraph) Casts this query as aSelectionQuerywith the given result graph.<X> SelectionQueryImplementor<X> asSelectionQuery(Class<X> type) Casts this query as aSelectionQuerywith the given result type.<X> SelectionQueryImplementor<X> setCacheRetrieveMode(CacheRetrieveMode cacheRetrieveMode) setCacheStoreMode(CacheStoreMode cacheStoreMode) setComment(String comment) Set the comment for this query.setConvertedParameter(int position, P value, Class<? extends AttributeConverter<P, ?>> converter) setConvertedParameter(String name, P value, Class<? extends AttributeConverter<P, ?>> converter) setFirstResult(int startPosition) setFlushMode(FlushModeType flushMode) Set a hint.setLockMode(LockModeType lockMode) setMaxResults(int maxResult) setParameter(int parameter, Object value) Bind the given argument to an ordinal query parameter.setParameter(int parameter, Instant value, TemporalType temporalType) Bind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.setParameter(int parameter, Calendar value, TemporalType temporalType) setParameter(int parameter, Date value, TemporalType temporalType) setParameter(int parameter, P value, Type<P> type) Bind the given argument to an ordinal query parameter using the givenType.setParameter(int parameter, P value, Class<P> type) setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType) setParameter(Parameter<Date> param, Date value, TemporalType temporalType) setParameter(Parameter<T> param, T value) setParameter(String parameter, Object value) Bind the given argument to a named query parameter.setParameter(String parameter, Instant value, TemporalType temporalType) Bind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.setParameter(String parameter, Calendar value, TemporalType temporalType) setParameter(String parameter, Date value, TemporalType temporalType) setParameter(String parameter, P value, Type<P> type) Bind the given argument to a named query parameter using the givenType.setParameter(String parameter, P value, Class<P> type) setParameter(QueryParameter<P> parameter, P val, Type<P> type) Bind an argument to the query parameter represented by the givenQueryParameter, using the givenType.setParameter(QueryParameter<P> parameter, P value, Class<P> type) Bind an argument to the query parameter represented by the givenQueryParameter, using the givenClassreference to attempt to infer theTypeto use.setParameter(QueryParameter<T> parameter, T value) Bind an argument to the query parameter represented by the givenQueryParameter.setParameterList(int parameter, Object[] values) Bind multiple arguments to an ordinal query parameter.setParameterList(int parameter, Collection values) Bind multiple arguments to an ordinal query parameter.setParameterList(int parameter, Collection<? extends P> values, Type<P> type) Bind multiple arguments to an ordinal query parameter using the givenType.setParameterList(int parameter, Collection<? extends P> values, Class<P> javaType) setParameterList(int parameter, P[] values, Type<P> type) Bind multiple arguments to an ordinal query parameter using the givenType.setParameterList(int parameter, P[] values, Class<P> javaType) setParameterList(String parameter, Object[] values) Bind multiple arguments to a named query parameter.setParameterList(String parameter, Collection values) Bind multiple arguments to a named query parameter.setParameterList(String parameter, Collection<? extends P> values, Type<P> type) Bind multiple arguments to a named query parameter using the givenType.setParameterList(String parameter, Collection<? extends P> values, Class<P> javaType) Bind multiple arguments to a named query parameter using the givenClassreference to attempt to infer theTypeIf unable to infer an appropriateType, fall back toCommonQueryContract.setParameterList(String, Collection).setParameterList(String parameter, P[] values, Type<P> type) Bind multiple arguments to a named query parameter using the givenType.setParameterList(String parameter, P[] values, Class<P> javaType) Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theTypeto use.setParameterList(QueryParameter<P> parameter, Collection<? extends P> values) Bind multiple arguments to the query parameter represented by the givenQueryParameter.setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Type<P> type) Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenType.setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType) Bind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theTypeto use.setParameterList(QueryParameter<P> parameter, P[] values) Bind multiple arguments to the query parameter represented by the givenQueryParameter.setParameterList(QueryParameter<P> parameter, P[] values, Type<P> type) Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theType.setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType) Bind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theTypeto use.setProperties(Object bean) 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.setProperties(Map bean) Bind the values of the givenMapto named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.setQueryFlushMode(QueryFlushMode queryFlushMode) Set theQueryFlushModeto use for this query.setTimeout(int timeout) Apply a timeout to the corresponding database query.setTimeout(Timeout timeout) Apply a timeout to the corresponding database query.setTimeout(Integer timeout) Apply a timeout to the corresponding database query.<X> SelectionQueryImplementor<X> withEntityGraph(EntityGraph<X> entityGraph) Methods inherited from interface CommonQueryContract
asSelectionQuery, getComment, getEffectiveFlushMode, getParameterMetadata, getQueryFlushMode, getTimeoutMethods inherited from interface Query
executeUpdate, getCacheRetrieveMode, getCacheStoreMode, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, getResultList, getResultStream, getSingleResult, getSingleResultOrNull, isBound, unwrap
-
Method Details
-
getSession
SharedSessionContractImplementor getSession()Description copied from interface:CommonQueryContract- Specified by:
getSessionin interfaceCommonQueryContract- Returns:
- The producer of this query
-
setQueryFlushMode
Description copied from interface:CommonQueryContractSet theQueryFlushModeto use for this query.- Specified by:
setQueryFlushModein interfaceCommonQueryContract- See Also:
-
setComment
Description copied from interface:CommonQueryContractSet the comment for this query.If SQL commenting is enabled, the comment will be added to the SQL query sent to the database, which may be useful for identifying the source of troublesome queries.
SQL commenting may be enabled using the configuration property "hibernate.use_sql_comments".
- Specified by:
setCommentin interfaceCommonQueryContract- See Also:
-
addQueryHint
Description copied from interface:CommonQueryContractAdd a database query hint to the SQL query.Multiple query hints may be specified. The operation
Dialect.getQueryHintString(String, List)determines how the hint is actually added to the SQL query.- Specified by:
addQueryHintin interfaceCommonQueryContract
-
setTimeout
Description copied from interface:CommonQueryContractApply a timeout to the corresponding database query.- Specified by:
setTimeoutin interfaceCommonQueryContract- See Also:
-
setTimeout
Description copied from interface:CommonQueryContractApply a timeout to the corresponding database query.- Specified by:
setTimeoutin interfaceCommonQueryContract- Specified by:
setTimeoutin interfaceQuery- See Also:
-
setTimeout
Description copied from interface:CommonQueryContractApply a timeout to the corresponding database query.- Specified by:
setTimeoutin interfaceCommonQueryContract- Specified by:
setTimeoutin interfaceQuery
-
setHint
Description copied from interface:CommonQueryContractSet a hint. Hints are a JPA-standard way to control provider-specific behavior affecting execution of the query. Clients of native Hibernate API should make use of type-safe operations of this interface and of its subtypes. For example,SelectionQuery.setCacheRegion(String)is preferred overHibernateHints.HINT_CACHE_REGION.The hints understood by Hibernate are enumerated by
AvailableHints.- Specified by:
setHintin interfaceCommonQueryContract- Specified by:
setHintin interfaceQuery- See Also:
-
asSelectionQuery
SelectionQueryImplementor<?> asSelectionQuery()Description copied from interface:CommonQueryContractCasts this query as aSelectionQuery.- Specified by:
asSelectionQueryin interfaceCommonQueryContract
-
asSelectionQuery
Description copied from interface:CommonQueryContractCasts this query as aSelectionQuerywith the given result type.- Specified by:
asSelectionQueryin interfaceCommonQueryContract
-
asSelectionQuery
Description copied from interface:CommonQueryContractCasts this query as aSelectionQuerywith the given result graph.- Specified by:
asSelectionQueryin interfaceCommonQueryContract
-
ofType
-
withEntityGraph
- Specified by:
withEntityGraphin interfaceQuery
-
asMutationQuery
MutationQueryImplementor<?> asMutationQuery()Description copied from interface:CommonQueryContractCasts this query as a mutation query.- Specified by:
asMutationQueryin interfaceCommonQueryContract
-
asStatement
MutationQueryImplementor<?> asStatement()- Specified by:
asStatementin interfaceQuery
-
getParameterBindings
QueryParameterBindings getParameterBindings() -
setParameter
Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the overloads which accepts a "type".
- Specified by:
setParameterin interfaceCommonQueryContract- Parameters:
parameter- the query parameter mementovalue- the argument, which might be null- Returns:
this, for method chaining- See Also:
-
setParameter
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the overloads which accepts a "type", or pass a
TypedParameterValue.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter.If the type of the parameter cannot be inferred from the context in which it occurs, use one of the overloads which accepts a "type", or pass a
TypedParameterValue.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
<P> CommonQueryContractImplementor setParameter(QueryParameter<P> parameter, P value, Class<P> type) Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter, using the givenClassreference to attempt to infer theTypeto use. If unable to infer an appropriateType, fall back toCommonQueryContract.setParameter(QueryParameter, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Parameters:
parameter- the query parameter mementovalue- the argument, which might be nulltype- aTyperepresenting the type of the parameter- Returns:
this, for method chaining- See Also:
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenClassreference to attempt to infer theType. If unable to infer an appropriateType, fall back toCommonQueryContract.setParameter(String, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theType. If unable to infer an appropriateType, fall back toCommonQueryContract.setParameter(int, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter, using the givenType.- Specified by:
setParameterin interfaceCommonQueryContract- Parameters:
parameter- the query parameter mementoval- the argument, which might be nulltype- aTyperepresenting the type of the parameter- Returns:
this, for method chaining
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery
-
setParameter
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenType.- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery
-
setProperties
Description copied from interface:CommonQueryContractBind 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.- Specified by:
setPropertiesin interfaceCommonQueryContract- Parameters:
bean- any JavaBean or POJO- Returns:
this, for method chaining
-
setProperties
Description copied from interface:CommonQueryContractBind the values of the givenMapto named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.- Specified by:
setPropertiesin interfaceCommonQueryContract- Parameters:
bean- aMapof names to arguments- Returns:
this, for method chaining
-
setConvertedParameter
<P> CommonQueryContractImplementor setConvertedParameter(String name, P value, Class<? extends AttributeConverter<P, ?>> converter) - Specified by:
setConvertedParameterin interfaceCommonQueryContract- Specified by:
setConvertedParameterin interfaceQuery- See Also:
-
setConvertedParameter
<P> CommonQueryContractImplementor setConvertedParameter(int position, P value, Class<? extends AttributeConverter<P, ?>> converter) - Specified by:
setConvertedParameterin interfaceCommonQueryContract- Specified by:
setConvertedParameterin interfaceQuery- See Also:
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter.The "type mapping" for the binding is inferred from the type of the first collection element.
- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(String parameter, Collection<? extends P> values, Class<P> javaType) Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenClassreference to attempt to infer theTypeIf unable to infer an appropriateType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(String parameter, Collection<? extends P> values, Type<P> type) Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter.The "type mapping" for the binding is inferred from the type of the first collection element
- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(String parameter, P[] values, Class<P> javaType) Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the given Class reference to attempt to determine theTypeto use. If unable to determine an appropriateType,CommonQueryContract.setParameterList(String, Collection)is used- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter.The "type mapping" for the binding is inferred from the type of the first collection element
- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(int parameter, Collection<? extends P> values, Class<P> javaType) Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theType. If unable to infer an appropriateType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(int parameter, Collection<? extends P> values, Type<P> type) Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter.The "type mapping" for the binding is inferred from the type of the first collection element
- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theType. If unable to infer an appropriateType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(QueryParameter<P> parameter, Collection<? extends P> values) Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter.The type of the parameter is inferred from the context in which it occurs, and from the type of the first given argument.
- Specified by:
setParameterListin interfaceCommonQueryContract- Parameters:
parameter- the parameter mementovalues- a collection of arguments- Returns:
this, for method chaining
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType) Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theTypeto use. If unable to infer an appropriateType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Type<P> type) Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter.The type of the parameter is inferred between the context in which it occurs, the type associated with the
QueryParameterand the type of the first given argument.- Specified by:
setParameterListin interfaceCommonQueryContract- Parameters:
parameter- the parameter mementovalues- a collection of arguments- Returns:
this, for method chaining
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType) Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameterusing the givenClassreference to attempt to infer theTypeto use. If unable to infer an appropriateType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
-
setParameterList
<P> CommonQueryContractImplementor setParameterList(QueryParameter<P> parameter, P[] values, Type<P> type) Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setMaxResults
- Specified by:
setMaxResultsin interfaceQuery
-
setFirstResult
- Specified by:
setFirstResultin interfaceQuery
-
setFlushMode
- Specified by:
setFlushModein interfaceQuery
-
setLockMode
- Specified by:
setLockModein interfaceQuery
-
setCacheRetrieveMode
- Specified by:
setCacheRetrieveModein interfaceQuery
-
setCacheStoreMode
- Specified by:
setCacheStoreModein interfaceQuery
-
setParameter
CommonQueryContractImplementor setParameter(String parameter, Instant value, TemporalType temporalType) Description copied from interface:CommonQueryContractBind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.- Specified by:
setParameterin interfaceCommonQueryContract
-
setParameter
CommonQueryContractImplementor setParameter(String parameter, Calendar value, TemporalType temporalType) - Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
CommonQueryContractImplementor setParameter(String parameter, Date value, TemporalType temporalType) - Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
CommonQueryContractImplementor setParameter(int parameter, Instant value, TemporalType temporalType) Description copied from interface:CommonQueryContractBind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.- Specified by:
setParameterin interfaceCommonQueryContract
-
setParameter
- Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
CommonQueryContractImplementor setParameter(int parameter, Calendar value, TemporalType temporalType) - Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
CommonQueryContractImplementor setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType) - Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-
setParameter
CommonQueryContractImplementor setParameter(Parameter<Date> param, Date value, TemporalType temporalType) - Specified by:
setParameterin interfaceCommonQueryContract- Specified by:
setParameterin interfaceQuery- See Also:
-