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 protected
QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory)
Used byProcedureCall
QueryParameterBindingImpl(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.T
getBindValue()
Get the value current bound.Collection<? extends T>
getBindValues()
Get the values currently bound.TemporalType
getExplicitTemporalPrecision()
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.TypeConfiguration
getTypeConfiguration()
boolean
isBound()
Is any value (includingnull
) bound? Asked another way, were any of the `#set` methods called?boolean
isMultiValued()
Is the binding multi-valued?void
setBindValue(T value, boolean resolveJdbcTypeIfNecessary)
Sets the parameter binding value.void
setBindValue(T value, TemporalType temporalTypePrecision)
Sets the parameter binding value using the explicit TemporalType.void
setBindValue(T value, BindableType<T> clarifiedType)
Sets the parameter binding value using the explicit Type.void
setBindValues(Collection<? extends T> values)
Sets the parameter binding values.void
setBindValues(Collection<? extends T> values, TemporalType temporalTypePrecision, TypeConfiguration typeConfiguration)
Sets the parameter binding value using the explicit TemporalType in regards to the individual values.void
setBindValues(Collection<? extends T> values, BindableType<T> clarifiedType)
Sets the parameter binding values using the explicit Type in regards to the individual values.boolean
setType(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:QueryParameterBinding
Get the Type currently associated with this binding.- Specified by:
getBindType
in interfaceQueryParameterBinding<T>
- Returns:
- The currently associated Type
-
getExplicitTemporalPrecision
public TemporalType getExplicitTemporalPrecision()
Description copied from interface:QueryParameterBinding
If the parameter represents a temporal type, return the explicitly specified precision - if one.- Specified by:
getExplicitTemporalPrecision
in interfaceQueryParameterBinding<T>
-
isBound
public boolean isBound()
Description copied from interface:QueryParameterBinding
Is any value (includingnull
) bound? Asked another way, were any of the `#set` methods called?- Specified by:
isBound
in interfaceQueryParameterBinding<T>
-
isMultiValued
public boolean isMultiValued()
Description copied from interface:QueryParameterBinding
Is the binding multi-valued?- Specified by:
isMultiValued
in interfaceQueryParameterBinding<T>
-
getBindValue
public T getBindValue()
Description copied from interface:QueryParameterBinding
Get the value current bound.- Specified by:
getBindValue
in interfaceQueryParameterBinding<T>
- Returns:
- The currently bound value
-
setBindValue
public void setBindValue(T value, boolean resolveJdbcTypeIfNecessary)
Description copied from interface:QueryParameterBinding
Sets 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:
setBindValue
in interfaceQueryParameterBinding<T>
-
setBindValue
public void setBindValue(T value, BindableType<T> clarifiedType)
Description copied from interface:QueryParameterBinding
Sets the parameter binding value using the explicit Type.- Specified by:
setBindValue
in interfaceQueryParameterBinding<T>
- Parameters:
value
- The bind valueclarifiedType
- The explicit Type to use
-
setBindValue
public void setBindValue(T value, TemporalType temporalTypePrecision)
Description copied from interface:QueryParameterBinding
Sets the parameter binding value using the explicit TemporalType.- Specified by:
setBindValue
in interfaceQueryParameterBinding<T>
- Parameters:
value
- The bind valuetemporalTypePrecision
- The temporal type to use
-
getBindValues
public Collection<? extends T> getBindValues()
Description copied from interface:QueryParameterBinding
Get the values currently bound.- Specified by:
getBindValues
in interfaceQueryParameterBinding<T>
- Returns:
- The currently bound values
-
setBindValues
public void setBindValues(Collection<? extends T> values)
Description copied from interface:QueryParameterBinding
Sets the parameter binding values. The inherent parameter type (if known) is assumed in regards to the individual values.- Specified by:
setBindValues
in interfaceQueryParameterBinding<T>
- Parameters:
values
- The bind values
-
setBindValues
public void setBindValues(Collection<? extends T> values, BindableType<T> clarifiedType)
Description copied from interface:QueryParameterBinding
Sets the parameter binding values using the explicit Type in regards to the individual values.- Specified by:
setBindValues
in 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:QueryParameterBinding
Sets the parameter binding value using the explicit TemporalType in regards to the individual values.- Specified by:
setBindValues
in interfaceQueryParameterBinding<T>
- Parameters:
values
- The bind valuestemporalTypePrecision
- The temporal type to use
-
getType
public MappingModelExpressible<T> getType()
Description copied from interface:QueryParameterBinding
Returns the inferred mapping model expressible i.e. the model reference against which this parameter is compared.- Specified by:
getType
in interfaceQueryParameterBinding<T>
- Returns:
- the inferred mapping model expressible or
null
-
setType
public boolean setType(MappingModelExpressible<T> type)
Description copied from interface:QueryParameterBinding
Sets the mapping model expressible for this parameter.- Specified by:
setType
in interfaceQueryParameterBinding<T>
- Parameters:
type
- The mapping model expressible- Returns:
- Whether the bind type was changed
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
- Specified by:
getTypeConfiguration
in interfaceJavaType.CoercionContext
-
-