Interface SqmQuery
-
- All Superinterfaces:
CommonQueryContract
- All Known Subinterfaces:
SqmQueryImplementor<R>,SqmSelectionQuery<R>
- All Known Implementing Classes:
QuerySqmImpl,SqmSelectionQueryImpl
public interface SqmQuery extends CommonQueryContract
Query based on an SQM tree.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ParameterMetadatagetParameterMetadata()QueryOptionsgetQueryOptions()StringgetQueryString()SqmStatementgetSqmStatement()SqmQuerysetHibernateFlushMode(FlushMode flushMode)Set the currentFlushModein effect for this query.SqmQuerysetParameter(int position, Object value)Bind the given argument to an ordinal query parameter.SqmQuerysetParameter(int position, Instant value, TemporalType temporalType)Bind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.SqmQuerysetParameter(int position, Calendar value, TemporalType temporalType)SqmQuerysetParameter(int position, Date value, TemporalType temporalType)<P> SqmQuerysetParameter(int position, P value, Class<P> type)Bind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmQuerysetParameter(int position, P value, BindableType<P> type)Bind the given argument to an ordinal query parameter using the givenBindableType.SqmQuerysetParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)SqmQuerysetParameter(Parameter<Date> param, Date value, TemporalType temporalType)<T> SqmQuerysetParameter(Parameter<T> param, T value)SqmQuerysetParameter(String name, Object value)Bind the given argument to a named query parameter.SqmQuerysetParameter(String name, Instant value, TemporalType temporalType)Bind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.SqmQuerysetParameter(String name, Calendar value, TemporalType temporalType)SqmQuerysetParameter(String name, Date value, TemporalType temporalType)<P> SqmQuerysetParameter(String name, P value, Class<P> type)Bind the given argument to a named query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmQuerysetParameter(String name, P value, BindableType<P> type)Bind the given argument to a named query parameter using the givenBindableType.<P> SqmQuerysetParameter(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 theBindableTypeto use.<P> SqmQuerysetParameter(QueryParameter<P> parameter, P val, BindableType<P> type)Bind an argument to the query parameter represented by the givenQueryParameter, using the givenBindableType.<T> SqmQuerysetParameter(QueryParameter<T> parameter, T value)Bind an argument to the query parameter represented by the givenQueryParameter.SqmQuerysetParameterList(int position, Object[] values)Bind multiple arguments to an ordinal query parameter.SqmQuerysetParameterList(int position, Collection values)Bind multiple arguments to an ordinal query parameter.<P> SqmQuerysetParameterList(int position, Collection<? extends P> values, Class<P> javaType)Bind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmQuerysetParameterList(int position, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.<P> SqmQuerysetParameterList(int position, P[] values, Class<P> javaType)Bind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> SqmQuerysetParameterList(int position, P[] values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.SqmQuerysetParameterList(String name, Object[] values)Bind multiple arguments to a named query parameter.SqmQuerysetParameterList(String name, Collection values)Bind multiple arguments to a named query parameter.<P> SqmQuerysetParameterList(String name, Collection<? extends P> values, Class<P> javaType)Bind multiple arguments to a named query parameter using the givenClassreference to attempt to infer theBindableTypeIf unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).<P> SqmQuerysetParameterList(String name, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> SqmQuerysetParameterList(String name, P[] values, Class<P> javaType)Bind multiple arguments to a named query parameter using the given Class reference to attempt to determine theBindableTypeto use.<P> SqmQuerysetParameterList(String name, P[] values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> SqmQuerysetParameterList(QueryParameter<P> parameter, Collection<? extends P> values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> SqmQuerysetParameterList(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 theBindableTypeto use.<P> SqmQuerysetParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenBindableType.<P> SqmQuerysetParameterList(QueryParameter<P> parameter, P[] values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> SqmQuerysetParameterList(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 theBindableTypeto use.<P> SqmQuerysetParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theBindableType.SqmQuerysetProperties(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.SqmQuerysetProperties(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.-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getComment, getFlushMode, getHibernateFlushMode, getTimeout, setComment, setFlushMode, setHint, setTimeout
-
-
-
-
Method Detail
-
getQueryString
String getQueryString()
-
getSqmStatement
SqmStatement getSqmStatement()
-
getParameterMetadata
ParameterMetadata getParameterMetadata()
-
getQueryOptions
QueryOptions getQueryOptions()
-
setParameter
SqmQuery setParameter(String name, Object value)
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 forms which accepts a "type".
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
CommonQueryContract.setParameter(String, Object, Class),CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
<P> SqmQuery setParameter(String name, P value, Class<P> type)
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(String, Object).- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
CommonQueryContract.setParameter(String, Object, BindableType)
-
setParameter
<P> SqmQuery setParameter(String name, P value, BindableType<P> type)
Description copied from interface:CommonQueryContractBind the given argument to a named query parameter using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract
-
setParameter
SqmQuery setParameter(String name, 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
SqmQuery setParameter(String name, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
SqmQuery setParameter(String name, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
SqmQuery setParameter(int position, Object value)
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 forms which accepts a "type".
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
CommonQueryContract.setParameter(int, Object, Class),CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
<P> SqmQuery setParameter(int position, P value, Class<P> type)
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(int, Object).- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
CommonQueryContract.setParameter(int, Object, BindableType)
-
setParameter
<P> SqmQuery setParameter(int position, P value, BindableType<P> type)
Description copied from interface:CommonQueryContractBind the given argument to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract
-
setParameter
SqmQuery setParameter(int position, 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
SqmQuery setParameter(int position, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameter
SqmQuery setParameter(int position, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
<T> SqmQuery setParameter(QueryParameter<T> parameter, T value)
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 forms 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:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
<P> SqmQuery 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 theBindableTypeto use. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameter(QueryParameter, Object).- Specified by:
setParameterin interfaceCommonQueryContract- Parameters:
parameter- the query parameter mementovalue- the argument, which might be nulltype- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
<P> SqmQuery setParameter(QueryParameter<P> parameter, P val, BindableType<P> type)
Description copied from interface:CommonQueryContractBind an argument to the query parameter represented by the givenQueryParameter, using the givenBindableType.- Specified by:
setParameterin interfaceCommonQueryContract- Parameters:
parameter- the query parameter mementoval- the argument, which might be nulltype- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining
-
setParameter
<T> SqmQuery setParameter(Parameter<T> param, T value)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
SqmQuery setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
SqmQuery setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameterList
SqmQuery setParameterList(String name, Collection values)
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:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
<P> SqmQuery setParameterList(String name, 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 theBindableTypeIf unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, java.util.Collection, BindableType)
-
setParameterList
<P> SqmQuery setParameterList(String name, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
SqmQuery setParameterList(String name, Object[] values)
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> SqmQuery setParameterList(String name, 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 theBindableTypeto use. If unable to determine an appropriateBindableType,CommonQueryContract.setParameterList(String, Collection)is used- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(java.lang.String, Object[], BindableType)
-
setParameterList
<P> SqmQuery setParameterList(String name, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to a named query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
SqmQuery setParameterList(int position, Collection values)
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> SqmQuery setParameterList(int position, 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 theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Collection, BindableType)
-
setParameterList
<P> SqmQuery setParameterList(int position, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
SqmQuery setParameterList(int position, Object[] values)
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> SqmQuery setParameterList(int position, P[] values, Class<P> javaType)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType. If unable to infer an appropriateBindableType, fall back toCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(int, Object[], BindableType)
-
setParameterList
<P> SqmQuery setParameterList(int position, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to an ordinal query parameter using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
<P> SqmQuery 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> SqmQuery 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 theBindableTypeto use. If unable to infer an appropriateBindableType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, java.util.Collection, BindableType)
-
setParameterList
<P> SqmQuery setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the givenBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setParameterList
<P> SqmQuery setParameterList(QueryParameter<P> parameter, P[] values)
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> SqmQuery 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 theBindableTypeto use. If unable to infer an appropriateBindableType, fall back to usingCommonQueryContract.setParameterList(String, Collection).- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameterList(QueryParameter, Object[], BindableType)
-
setParameterList
<P> SqmQuery setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)
Description copied from interface:CommonQueryContractBind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theBindableType.- Specified by:
setParameterListin interfaceCommonQueryContract- Returns:
this, for method chaining
-
setProperties
SqmQuery setProperties(Object bean)
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
SqmQuery setProperties(Map bean)
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
-
setHibernateFlushMode
SqmQuery setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:CommonQueryContractSet the currentFlushModein effect for this query.- Specified by:
setHibernateFlushModein interfaceCommonQueryContract- See Also:
CommonQueryContract.getHibernateFlushMode(),Session.getHibernateFlushMode()
-
-