Class AbstractCommonQueryContract
- java.lang.Object
-
- org.hibernate.query.spi.AbstractCommonQueryContract
-
- All Implemented Interfaces:
CommonQueryContract
- Direct Known Subclasses:
AbstractSelectionQuery
public abstract class AbstractCommonQueryContract extends Object implements CommonQueryContract
-
-
Constructor Summary
Constructors Constructor Description AbstractCommonQueryContract(SharedSessionContractImplementor session)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanapplyAdditionalPossibleHints(String hintName, Object value)protected voidapplyAliasSpecificLockModeHint(String hintName, Object value)protected voidapplyCacheableHint(boolean isCacheable)protected voidapplyCacheModeHint(CacheMode cacheMode)protected voidapplyCacheRegionHint(String regionName)protected voidapplyCommentHint(String comment)protected voidapplyEntityGraphHint(String hintName, Object value)protected voidapplyFetchSizeHint(int fetchSize)voidapplyFirstResult(int startPosition)protected voidapplyFlushModeHint(FlushMode flushMode)protected voidapplyFollowOnLockingHint(Boolean followOnLocking)protected voidapplyGraph(String graphString, GraphSemantic graphSemantic)protected voidapplyGraph(RootGraphImplementor<?> entityGraph, GraphSemantic graphSemantic)protected voidapplyHibernateLockMode(LockMode value)booleanapplyHint(String hintName, Object value)protected booleanapplyJpaCacheRetrieveModeHint(CacheRetrieveMode retrieveMode)protected booleanapplyJpaCacheStoreModeHint(CacheStoreMode storeMode)protected voidapplyJpaFlushMode(FlushModeType flushModeType)protected voidapplyLockModeHint(Object value)protected voidapplyLockModeType(LockModeType value)protected voidapplyLockTimeoutHint(int timeout)protected voidapplyLockTimeoutHint(Integer timeout)voidapplyMaxResults(int maxResult)booleanapplyResultListTransformer(ResultListTransformer<?> transformer)protected booleanapplySelectionHint(String hintName, Object value)protected voidapplySynchronizeSpacesHint(Object value)protected voidapplyTimeoutHint(int timeout)booleanapplyTupleTransformer(TupleTransformer<?> transformer)protected voidcollectHints(Map<String,Object> hints)protected BindableType<Object>determineType(String namedParam, Class<?> retType)StringgetComment()Get the comment that has been set for this query, if any.intgetFirstResult()FlushModegetHibernateFlushMode()TheFlushModein effect for this query.Map<String,Object>getHints()protected intgetIntegerLiteral(JpaExpression<Number> expression, int defaultValue)protected FlushModeTypegetJpaFlushMode()intgetMaxResults()protected intgetMaxRows(SqmSelectStatement<?> selectStatement, int size)QueryParameterImplementor<?>getParameter(int position)<T> QueryParameterImplementor<T>getParameter(int position, Class<T> type)QueryParameterImplementor<?>getParameter(String name)<T> QueryParameterImplementor<T>getParameter(String name, Class<T> type)protected abstract ParameterMetadataImplementorgetParameterMetadata()Set<Parameter<?>>getParameters()ObjectgetParameterValue(int position)<T> TgetParameterValue(Parameter<T> param)ObjectgetParameterValue(String name)MutableQueryOptionsgetQueryOptions()protected abstract QueryParameterBindingsgetQueryParameterBindings()SharedSessionContractImplementorgetSession()IntegergetTimeout()Obtain the query timeout in seconds.booleanisBound(Parameter<?> param)protected <P> QueryParameterBinding<P>locateBinding(int position)protected <P> QueryParameterBinding<P>locateBinding(Parameter<P> parameter)protected <P> QueryParameterBinding<P>locateBinding(String name)protected <P> QueryParameterBinding<P>locateBinding(QueryParameterImplementor<P> parameter)protected voidputIfNotNull(Map<String,Object> hints, String hintName, Enum<?> hintValue)protected voidputIfNotNull(Map<String,Object> hints, String hintName, Object hintValue)protected abstract booleanresolveJdbcParameterTypeIfNecessary()CommonQueryContractsetComment(String comment)Set a comment for this query.CommonQueryContractsetHibernateFlushMode(FlushMode flushMode)Set the currentFlushModein effect for this query.CommonQueryContractsetHint(String hintName, Object value)Set a hint.CommonQueryContractsetParameter(int position, Object value)Bind the given argument to an ordinal query parameter.CommonQueryContractsetParameter(int position, Instant value, TemporalType temporalType)Bind anInstantto an ordinal query parameter using just the portion indicated by the givenTemporalType.CommonQueryContractsetParameter(int position, Calendar value, TemporalType temporalType)CommonQueryContractsetParameter(int position, Date value, TemporalType temporalType)<P> CommonQueryContractsetParameter(int position, P value, Class<P> javaType)Bind the given argument to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> CommonQueryContractsetParameter(int position, P value, BindableType<P> type)Bind the given argument to an ordinal query parameter using the givenBindableType.CommonQueryContractsetParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)CommonQueryContractsetParameter(Parameter<Date> param, Date value, TemporalType temporalType)<P> CommonQueryContractsetParameter(Parameter<P> parameter, P value)CommonQueryContractsetParameter(String name, Object value)Bind the given argument to a named query parameter.CommonQueryContractsetParameter(String name, Instant value, TemporalType temporalType)Bind anInstantto the named query parameter using just the portion indicated by the givenTemporalType.CommonQueryContractsetParameter(String name, Calendar value, TemporalType temporalType)CommonQueryContractsetParameter(String name, Date value, TemporalType temporalType)<P> CommonQueryContractsetParameter(String name, P value, Class<P> javaType)Bind the given argument to a named query parameter using the givenClassreference to attempt to infer theBindableType.<P> CommonQueryContractsetParameter(String name, P value, BindableType<P> type)Bind the given argument to a named query parameter using the givenBindableType.<P> CommonQueryContractsetParameter(QueryParameter<P> parameter, P value)Bind an argument to the query parameter represented by the givenQueryParameter.<P> CommonQueryContractsetParameter(QueryParameter<P> parameter, P value, Class<P> javaType)Bind an argument to the query parameter represented by the givenQueryParameter, using the givenClassreference to attempt to infer theBindableTypeto use.<P> CommonQueryContractsetParameter(QueryParameter<P> parameter, P value, BindableType<P> type)Bind an argument to the query parameter represented by the givenQueryParameter, using the givenBindableType.CommonQueryContractsetParameterList(int position, Object[] values)Bind multiple arguments to an ordinal query parameter.CommonQueryContractsetParameterList(int position, Collection values)Bind multiple arguments to an ordinal query parameter.<P> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(int position, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.<P> CommonQueryContractsetParameterList(int position, P[] values, Class<P> javaType)Bind multiple arguments to an ordinal query parameter using the givenClassreference to attempt to infer theBindableType.<P> CommonQueryContractsetParameterList(int position, P[] values, BindableType<P> type)Bind multiple arguments to an ordinal query parameter using the givenBindableType.CommonQueryContractsetParameterList(String name, Object[] values)Bind multiple arguments to a named query parameter.CommonQueryContractsetParameterList(String name, Collection values)Bind multiple arguments to a named query parameter.<P> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(String name, Collection<? extends P> values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(String name, P[] values, BindableType<P> type)Bind multiple arguments to a named query parameter using the givenBindableType.<P> CommonQueryContractsetParameterList(QueryParameter<P> parameter, Collection<? extends P> values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(QueryParameter<P> parameter, P[] values)Bind multiple arguments to the query parameter represented by the givenQueryParameter.<P> CommonQueryContractsetParameterList(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> CommonQueryContractsetParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type)Bind multiple arguments to the query parameter represented by the givenQueryParameter, using the given theBindableType.CommonQueryContractsetProperties(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.CommonQueryContractsetProperties(Map map)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.CommonQueryContractsetTimeout(int timeout)Set the query timeout in seconds.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.CommonQueryContract
getFlushMode, setFlushMode
-
-
-
-
Constructor Detail
-
AbstractCommonQueryContract
public AbstractCommonQueryContract(SharedSessionContractImplementor session)
-
-
Method Detail
-
getSession
public SharedSessionContractImplementor getSession()
-
getIntegerLiteral
protected int getIntegerLiteral(JpaExpression<Number> expression, int defaultValue)
-
getMaxRows
protected int getMaxRows(SqmSelectStatement<?> selectStatement, int size)
-
putIfNotNull
protected void putIfNotNull(Map<String,Object> hints, String hintName, Enum<?> hintValue)
-
putIfNotNull
protected void putIfNotNull(Map<String,Object> hints, String hintName, Object hintValue)
-
setHint
public CommonQueryContract setHint(String hintName, Object value)
Description copied from interface:CommonQueryContractSet a hint. The hints understood by Hibernate are enumerated byAvailableHints.- Specified by:
setHintin interfaceCommonQueryContract- See Also:
HibernateHints,SpecHints
-
applySynchronizeSpacesHint
protected void applySynchronizeSpacesHint(Object value)
-
applyFetchSizeHint
protected void applyFetchSizeHint(int fetchSize)
-
applyCacheModeHint
protected void applyCacheModeHint(CacheMode cacheMode)
-
applyCacheableHint
protected void applyCacheableHint(boolean isCacheable)
-
applyCacheRegionHint
protected void applyCacheRegionHint(String regionName)
-
applyGraph
protected void applyGraph(String graphString, GraphSemantic graphSemantic)
-
applyGraph
protected void applyGraph(RootGraphImplementor<?> entityGraph, GraphSemantic graphSemantic)
-
applyLockTimeoutHint
protected void applyLockTimeoutHint(Integer timeout)
-
applyLockTimeoutHint
protected void applyLockTimeoutHint(int timeout)
-
applyHibernateLockMode
protected void applyHibernateLockMode(LockMode value)
-
applyLockModeType
protected void applyLockModeType(LockModeType value)
-
applyLockModeHint
protected final void applyLockModeHint(Object value)
-
applyAliasSpecificLockModeHint
protected void applyAliasSpecificLockModeHint(String hintName, Object value)
-
applyFollowOnLockingHint
protected void applyFollowOnLockingHint(Boolean followOnLocking)
-
applyAdditionalPossibleHints
protected boolean applyAdditionalPossibleHints(String hintName, Object value)
-
getComment
public String getComment()
Description copied from interface:CommonQueryContractGet the comment that has been set for this query, if any.- Specified by:
getCommentin interfaceCommonQueryContract
-
setComment
public CommonQueryContract setComment(String comment)
Description copied from interface:CommonQueryContractSet a comment for this query.- Specified by:
setCommentin interfaceCommonQueryContract- See Also:
Query.setComment(String)
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
Description copied from interface:CommonQueryContractTheFlushModein effect for this query. By default, the query inherits theFlushModeof theSessionfrom which it originates.- Specified by:
getHibernateFlushModein interfaceCommonQueryContract- See Also:
Session.getHibernateFlushMode()
-
setHibernateFlushMode
public CommonQueryContract setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:CommonQueryContractSet the currentFlushModein effect for this query.- Specified by:
setHibernateFlushModein interfaceCommonQueryContract- See Also:
CommonQueryContract.getHibernateFlushMode(),Session.getHibernateFlushMode()
-
applyJpaCacheRetrieveModeHint
protected boolean applyJpaCacheRetrieveModeHint(CacheRetrieveMode retrieveMode)
-
applyJpaCacheStoreModeHint
protected boolean applyJpaCacheStoreModeHint(CacheStoreMode storeMode)
-
applyTimeoutHint
protected void applyTimeoutHint(int timeout)
-
applyCommentHint
protected void applyCommentHint(String comment)
-
applyFlushModeHint
protected void applyFlushModeHint(FlushMode flushMode)
-
getQueryOptions
public MutableQueryOptions getQueryOptions()
-
getTimeout
public Integer getTimeout()
Description copied from interface:CommonQueryContractObtain the query timeout in seconds.This value is eventually passed along to the JDBC statement via
Statement.setQueryTimeout(int).A value of zero indicates no timeout.
- Specified by:
getTimeoutin interfaceCommonQueryContract- See Also:
Statement.getQueryTimeout(),Statement.setQueryTimeout(int)
-
setTimeout
public CommonQueryContract setTimeout(int timeout)
Description copied from interface:CommonQueryContractSet the query timeout in seconds.Any value set here is eventually passed directly along to the JDBC statement, which expressly disallows negative values. So negative values should be avoided as a general rule.
A value of zero indicates no timeout.
- Specified by:
setTimeoutin interfaceCommonQueryContract- Parameters:
timeout- the timeout in seconds- Returns:
this, for method chaining- See Also:
CommonQueryContract.getTimeout()
-
getMaxResults
public int getMaxResults()
-
applyMaxResults
public void applyMaxResults(int maxResult)
-
getFirstResult
public int getFirstResult()
-
applyFirstResult
public void applyFirstResult(int startPosition)
-
getJpaFlushMode
protected FlushModeType getJpaFlushMode()
-
applyJpaFlushMode
protected void applyJpaFlushMode(FlushModeType flushModeType)
-
applyTupleTransformer
public boolean applyTupleTransformer(TupleTransformer<?> transformer)
-
applyResultListTransformer
public boolean applyResultListTransformer(ResultListTransformer<?> transformer)
-
getParameterMetadata
protected abstract ParameterMetadataImplementor getParameterMetadata()
-
getParameter
public QueryParameterImplementor<?> getParameter(String name)
-
getParameter
public <T> QueryParameterImplementor<T> getParameter(String name, Class<T> type)
-
getParameter
public QueryParameterImplementor<?> getParameter(int position)
-
getParameter
public <T> QueryParameterImplementor<T> getParameter(int position, Class<T> type)
-
getQueryParameterBindings
protected abstract QueryParameterBindings getQueryParameterBindings()
-
resolveJdbcParameterTypeIfNecessary
protected abstract boolean resolveJdbcParameterTypeIfNecessary()
-
locateBinding
protected <P> QueryParameterBinding<P> locateBinding(Parameter<P> parameter)
-
locateBinding
protected <P> QueryParameterBinding<P> locateBinding(QueryParameterImplementor<P> parameter)
-
locateBinding
protected <P> QueryParameterBinding<P> locateBinding(String name)
-
locateBinding
protected <P> QueryParameterBinding<P> locateBinding(int position)
-
isBound
public boolean isBound(Parameter<?> param)
-
getParameterValue
public <T> T getParameterValue(Parameter<T> param)
-
getParameterValue
public Object getParameterValue(int position)
-
setParameter
public CommonQueryContract 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
public <P> CommonQueryContract setParameter(String name, P value, Class<P> javaType)
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
public <P> CommonQueryContract 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
public CommonQueryContract 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
public CommonQueryContract 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
public <P> CommonQueryContract setParameter(int position, P value, Class<P> javaType)
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
public <P> CommonQueryContract 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
public CommonQueryContract 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
public <P> CommonQueryContract setParameter(QueryParameter<P> parameter, P 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
public <P> CommonQueryContract setParameter(QueryParameter<P> parameter, P value, Class<P> javaType)
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 nulljavaType- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining- See Also:
CommonQueryContract.setParameter(QueryParameter, Object, BindableType)
-
setParameter
public <P> CommonQueryContract setParameter(QueryParameter<P> parameter, P value, 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 mementovalue- the argument, which might be nulltype- aBindableTyperepresenting the type of the parameter- Returns:
this, for method chaining
-
setParameter
public <P> CommonQueryContract setParameter(Parameter<P> parameter, P value)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Object)
-
setParameter
public CommonQueryContract setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Calendar, TemporalType)
-
setParameter
public CommonQueryContract setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(Parameter, Date, TemporalType)
-
setParameter
public CommonQueryContract setParameter(String name, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(String, Calendar, TemporalType)
-
setParameter
public CommonQueryContract setParameter(String name, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(String, Date, TemporalType)
-
setParameter
public CommonQueryContract setParameter(int position, Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(int, Calendar, TemporalType)
-
setParameter
public CommonQueryContract setParameter(int position, Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceCommonQueryContract- See Also:
Query.setParameter(int, Date, TemporalType)
-
setParameterList
public CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public <P> CommonQueryContract 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
public CommonQueryContract setProperties(Map map)
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:
map- aMapof names to arguments- Returns:
this, for method chaining
-
determineType
protected BindableType<Object> determineType(String namedParam, Class<?> retType)
-
setProperties
public CommonQueryContract 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
-
-