Package org.hibernate.query.internal
Class QueryParameterBindingImpl<T>
- java.lang.Object
-
- org.hibernate.query.internal.QueryParameterBindingImpl<T>
-
- All Implemented Interfaces:
QueryParameterBinding<T>,JavaType.CoercionContext
- Direct Known Subclasses:
ProcedureParameterBindingImpl
public class QueryParameterBindingImpl<T> extends Object implements QueryParameterBinding<T>, JavaType.CoercionContext
The standard Hibernate QueryParameterBinding implementation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedQueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory)Used byProcedureCallQueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory, BindableType<T> bindType)Used by Query (SQM) and NativeQuery
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BindableType<? extends T>getBindType()Get the Type currently associated with this binding.TgetBindValue()Get the value current bound.Collection<? extends T>getBindValues()Get the values currently bound.TemporalTypegetExplicitTemporalPrecision()If the parameter represents a temporal type, return the explicitly specified precision - if one.MappingModelExpressible<T>getType()Returns the inferred mapping model expressible i.e.TypeConfigurationgetTypeConfiguration()booleanisBound()Is any value (includingnull) bound? Asked another way, were any of the `#set` methods called?booleanisMultiValued()Is the binding multi-valued?voidsetBindValue(T value, boolean resolveJdbcTypeIfNecessary)Sets the parameter binding value.voidsetBindValue(T value, TemporalType temporalTypePrecision)Sets the parameter binding value using the explicit TemporalType.voidsetBindValue(T value, BindableType<T> clarifiedType)Sets the parameter binding value using the explicit Type.voidsetBindValues(Collection<? extends T> values)Sets the parameter binding values.voidsetBindValues(Collection<? extends T> values, TemporalType temporalTypePrecision, TypeConfiguration typeConfiguration)Sets the parameter binding value using the explicit TemporalType in regards to the individual values.voidsetBindValues(Collection<? extends T> values, BindableType<T> clarifiedType)Sets the parameter binding values using the explicit Type in regards to the individual values.booleansetType(MappingModelExpressible<T> type)Sets the mapping model expressible for this parameter.-
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.spi.QueryParameterBinding
setBindValue
-
-
-
-
Constructor Detail
-
QueryParameterBindingImpl
protected QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory)
Used byProcedureCall
-
QueryParameterBindingImpl
public QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory, BindableType<T> bindType)
Used by Query (SQM) and NativeQuery
-
-
Method Detail
-
getBindType
public BindableType<? extends T> getBindType()
Description copied from interface:QueryParameterBindingGet the Type currently associated with this binding.- Specified by:
getBindTypein interfaceQueryParameterBinding<T>- Returns:
- The currently associated Type
-
getExplicitTemporalPrecision
public TemporalType getExplicitTemporalPrecision()
Description copied from interface:QueryParameterBindingIf the parameter represents a temporal type, return the explicitly specified precision - if one.- Specified by:
getExplicitTemporalPrecisionin interfaceQueryParameterBinding<T>
-
isBound
public boolean isBound()
Description copied from interface:QueryParameterBindingIs any value (includingnull) bound? Asked another way, were any of the `#set` methods called?- Specified by:
isBoundin interfaceQueryParameterBinding<T>
-
isMultiValued
public boolean isMultiValued()
Description copied from interface:QueryParameterBindingIs the binding multi-valued?- Specified by:
isMultiValuedin interfaceQueryParameterBinding<T>
-
getBindValue
public T getBindValue()
Description copied from interface:QueryParameterBindingGet the value current bound.- Specified by:
getBindValuein interfaceQueryParameterBinding<T>- Returns:
- The currently bound value
-
setBindValue
public void setBindValue(T value, boolean resolveJdbcTypeIfNecessary)
Description copied from interface:QueryParameterBindingSets the parameter binding value. The inherent parameter type (if known) is assumed. The flag controls whether the parameter type should be resolved if necessary.- Specified by:
setBindValuein interfaceQueryParameterBinding<T>
-
setBindValue
public void setBindValue(T value, BindableType<T> clarifiedType)
Description copied from interface:QueryParameterBindingSets the parameter binding value using the explicit Type.- Specified by:
setBindValuein interfaceQueryParameterBinding<T>- Parameters:
value- The bind valueclarifiedType- The explicit Type to use
-
setBindValue
public void setBindValue(T value, TemporalType temporalTypePrecision)
Description copied from interface:QueryParameterBindingSets the parameter binding value using the explicit TemporalType.- Specified by:
setBindValuein interfaceQueryParameterBinding<T>- Parameters:
value- The bind valuetemporalTypePrecision- The temporal type to use
-
getBindValues
public Collection<? extends T> getBindValues()
Description copied from interface:QueryParameterBindingGet the values currently bound.- Specified by:
getBindValuesin interfaceQueryParameterBinding<T>- Returns:
- The currently bound values
-
setBindValues
public void setBindValues(Collection<? extends T> values)
Description copied from interface:QueryParameterBindingSets the parameter binding values. The inherent parameter type (if known) is assumed in regards to the individual values.- Specified by:
setBindValuesin interfaceQueryParameterBinding<T>- Parameters:
values- The bind values
-
setBindValues
public void setBindValues(Collection<? extends T> values, BindableType<T> clarifiedType)
Description copied from interface:QueryParameterBindingSets the parameter binding values using the explicit Type in regards to the individual values.- Specified by:
setBindValuesin interfaceQueryParameterBinding<T>- Parameters:
values- The bind valuesclarifiedType- The explicit Type to use
-
setBindValues
public void setBindValues(Collection<? extends T> values, TemporalType temporalTypePrecision, TypeConfiguration typeConfiguration)
Description copied from interface:QueryParameterBindingSets the parameter binding value using the explicit TemporalType in regards to the individual values.- Specified by:
setBindValuesin interfaceQueryParameterBinding<T>- Parameters:
values- The bind valuestemporalTypePrecision- The temporal type to use
-
getType
public MappingModelExpressible<T> getType()
Description copied from interface:QueryParameterBindingReturns the inferred mapping model expressible i.e. the model reference against which this parameter is compared.- Specified by:
getTypein interfaceQueryParameterBinding<T>- Returns:
- the inferred mapping model expressible or
null
-
setType
public boolean setType(MappingModelExpressible<T> type)
Description copied from interface:QueryParameterBindingSets the mapping model expressible for this parameter.- Specified by:
setTypein interfaceQueryParameterBinding<T>- Parameters:
type- The mapping model expressible- Returns:
- Whether the bind type was changed
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
- Specified by:
getTypeConfigurationin interfaceJavaType.CoercionContext
-
-