Top Description Fields Constructors Methods
org.hibernate.query.internal

public Class QueryParameterBindingImpl<T>

extends Object
implements QueryParameterBinding<T>, CoercionContext
Class Inheritance
All Implemented Interfaces
org.hibernate.type.descriptor.java.JavaType.CoercionContext, org.hibernate.query.spi.QueryParameterBinding
Known Direct Subclasses
org.hibernate.procedure.internal.ProcedureParameterBindingImpl
Imports
java.util.Collection, .Iterator, org.hibernate.HibernateException, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.metamodel.mapping.BasicValuedMapping, .JdbcMapping, .MappingModelExpressible, .ModelPart, org.hibernate.query.BindableType, .QueryParameter, org.hibernate.query.spi.QueryParameterBinding, .QueryParameterBindingValidator, org.hibernate.query.sqm.SqmExpressible, org.hibernate.type.descriptor.java.JavaType, .JavaTypeHelper, org.hibernate.type.spi.TypeConfiguration, jakarta.persistence.TemporalType

The standard implementation of QueryParameterBinding.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private BindableType<? super T>
private Object
private Collection<? extends T>
private TemporalType
private boolean
private boolean
private final QueryParameter<T>
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private MappingModelExpressible<T>

Constructor Summary

AccessConstructor and Description
protected
QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Used by org.hibernate.procedure.ProcedureCall
public
QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory, BindableType<T> bindType)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Used by Query (SQM) and NativeQuery

Method Summary

Modifier and TypeMethod and Description
private void
bindNull(boolean resolveJdbcTypeIfNecessary)

private void
private Object
coerce(T value, BindableType<? super T> parameterType)

private JavaType<? super T>
determineJavaType(BindableType<? super T> bindType)

public BindableType<? super T>
getBindType()

Implements org.hibernate.query.spi.QueryParameterBinding.getBindType.

Get the Type currently associated with this binding.
public T
public Collection<? extends T>
public TemporalType
getExplicitTemporalPrecision()

Implements org.hibernate.query.spi.QueryParameterBinding.getExplicitTemporalPrecision.

If the parameter represents a temporal type, return the explicitly specified precision - if one.
public MappingModelExpressible<T>
getType()

Implements org.hibernate.query.spi.QueryParameterBinding.getType.

Returns the inferred mapping model expressible i.e. the model reference against which this parameter is compared.
public TypeConfiguration
private boolean
handleAsMultiValue(T value, BindableType<T> bindableType)

public boolean
isBound()

Implements org.hibernate.query.spi.QueryParameterBinding.isBound.

Is any value (including null) bound?
public boolean
private boolean
public void
setBindValue(T value, boolean resolveJdbcTypeIfNecessary)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Sets the parameter binding value.
public void
setBindValue(T
The bind value
value
,
BindableType<T>
The explicit Type to use
clarifiedType
)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Sets the parameter binding value using the explicit Type.
public void
setBindValue(T
The bind value
value
,
TemporalType
The temporal type to use
temporalTypePrecision
)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Sets the parameter binding value using the explicit TemporalType.
public void
setBindValues(Collection<? extends T>
The bind values
values
)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding values.
public void
setBindValues(Collection<? extends T>
The bind values
values
,
BindableType<T>
The explicit Type to use
clarifiedType
)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding values using the explicit Type in regards to the individual values.
public void
setBindValues(Collection<? extends T>
The bind values
values
,
TemporalType
The temporal type to use
temporalTypePrecision
,
TypeConfiguration typeConfiguration)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding value using the explicit TemporalType in regards to the individual values.
private void
public boolean
setType(MappingModelExpressible<T>
The mapping model expressible
type
)

Implements org.hibernate.query.spi.QueryParameterBinding.setType.

Sets the mapping model expressible for this parameter.
private void
private void
validate(Object value, BindableType<?> clarifiedType)

private void
validate(Object value, TemporalType clarifiedTemporalType)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindTypeback to summary
private BindableType<? super T> bindType
bindValueback to summary
private Object bindValue
bindValuesback to summary
private Collection<? extends T> bindValues
explicitTemporalPrecisionback to summary
private TemporalType explicitTemporalPrecision
isBoundback to summary
private boolean isBound
isMultiValuedback to summary
private boolean isMultiValued
queryParameterback to summary
private final QueryParameter<T> queryParameter
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

typeback to summary
private MappingModelExpressible<T> type

Constructor Detail

QueryParameterBindingImplback to summary
protected QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Used by org.hibernate.procedure.ProcedureCall

QueryParameterBindingImplback to summary
public QueryParameterBindingImpl(QueryParameter<T> queryParameter, SessionFactoryImplementor sessionFactory, BindableType<T> bindType)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Used by Query (SQM) and NativeQuery

Method Detail

bindNullback to summary
private void bindNull(boolean resolveJdbcTypeIfNecessary)
bindValueback to summary
private void bindValue(Object value)
coerceback to summary
private Object coerce(T value, BindableType<? super T> parameterType)
determineJavaTypeback to summary
private JavaType<? super T> determineJavaType(BindableType<? super T> bindType)
getBindTypeback to summary
public BindableType<? super T> getBindType()

Implements org.hibernate.query.spi.QueryParameterBinding.getBindType.

Doc from org.hibernate.query.spi.QueryParameterBinding.getBindType.

Get the Type currently associated with this binding.

Returns:BindableType<? super T>

The currently associated Type

Annotations
@Override
getBindValueback to summary
public T getBindValue()

Implements org.hibernate.query.spi.QueryParameterBinding.getBindValue.

Doc from org.hibernate.query.spi.QueryParameterBinding.getBindValue.

Get the value current bound.

Returns:T

The currently bound value

Annotations
@Override
getBindValuesback to summary
public Collection<? extends T> getBindValues()

Implements org.hibernate.query.spi.QueryParameterBinding.getBindValues.

Doc from org.hibernate.query.spi.QueryParameterBinding.getBindValues.

Get the values currently bound.

Returns:Collection<? extends T>

The currently bound values

Annotations
@Override
getExplicitTemporalPrecisionback to summary
public TemporalType getExplicitTemporalPrecision()

Implements org.hibernate.query.spi.QueryParameterBinding.getExplicitTemporalPrecision.

Doc from org.hibernate.query.spi.QueryParameterBinding.getExplicitTemporalPrecision.

If the parameter represents a temporal type, return the explicitly specified precision - if one.

Annotations
@Override
getTypeback to summary
public MappingModelExpressible<T> getType()

Implements org.hibernate.query.spi.QueryParameterBinding.getType.

Doc from org.hibernate.query.spi.QueryParameterBinding.getType.

Returns the inferred mapping model expressible i.e. the model reference against which this parameter is compared.

Returns:MappingModelExpressible<T>

the inferred mapping model expressible or null

Annotations
@Override
getTypeConfigurationback to summary
public TypeConfiguration getTypeConfiguration()

Implements org.hibernate.type.descriptor.java.JavaType.CoercionContext.getTypeConfiguration.

Annotations
@Override
handleAsMultiValueback to summary
private boolean handleAsMultiValue(T value, BindableType<T> bindableType)
isBoundback to summary
public boolean isBound()

Implements org.hibernate.query.spi.QueryParameterBinding.isBound.

Doc from org.hibernate.query.spi.QueryParameterBinding.isBound.

Is any value (including null) bound? Asked another way, were any of the `#set` methods called?

Annotations
@Override
isMultiValuedback to summary
public boolean isMultiValued()

Implements org.hibernate.query.spi.QueryParameterBinding.isMultiValued.

Doc from org.hibernate.query.spi.QueryParameterBinding.isMultiValued.

Is the binding multivalued?

Annotations
@Override
isRegisteredAsBasicTypeback to summary
private boolean isRegisteredAsBasicType(Class<?> valueClass)
setBindValueback to summary
public void setBindValue(T value, boolean resolveJdbcTypeIfNecessary)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValue.

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.

Annotations
@Override
setBindValueback to summary
public void setBindValue(T value, BindableType<T> clarifiedType)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Sets the parameter binding value using the explicit Type.

Parameters
value:T

The bind value

clarifiedType:BindableType<T>

The explicit Type to use

Annotations
@Override
setBindValueback to summary
public void setBindValue(T value, TemporalType temporalTypePrecision)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValue.

Sets the parameter binding value using the explicit TemporalType.

Parameters
value:T

The bind value

temporalTypePrecision:TemporalType

The temporal type to use

Annotations
@Override
setBindValuesback to summary
public void setBindValues(Collection<? extends T> values)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding values. The inherent parameter type (if known) is assumed in regards to the individual values.

Parameters
values:Collection<? extends T>

The bind values

Annotations
@Override
setBindValuesback to summary
public void setBindValues(Collection<? extends T> values, BindableType<T> clarifiedType)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding values using the explicit Type in regards to the individual values.

Parameters
values:Collection<? extends T>

The bind values

clarifiedType:BindableType<T>

The explicit Type to use

Annotations
@Override
setBindValuesback to summary
public void setBindValues(Collection<? extends T> values, TemporalType temporalTypePrecision, TypeConfiguration typeConfiguration)

Implements org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Doc from org.hibernate.query.spi.QueryParameterBinding.setBindValues.

Sets the parameter binding value using the explicit TemporalType in regards to the individual values.

Parameters
values:Collection<? extends T>

The bind values

temporalTypePrecision:TemporalType

The temporal type to use

Annotations
@Override
setExplicitTemporalPrecisionback to summary
private void setExplicitTemporalPrecision(TemporalType precision)
setTypeback to summary
public boolean setType(MappingModelExpressible<T> type)

Implements org.hibernate.query.spi.QueryParameterBinding.setType.

Doc from org.hibernate.query.spi.QueryParameterBinding.setType.

Sets the mapping model expressible for this parameter.

Parameters
type:MappingModelExpressible<T>

The mapping model expressible

Returns:boolean

Whether the bind type was changed

Annotations
@Override
@SuppressWarnings:unchecked
validateback to summary
private void validate(Object value)
validateback to summary
private void validate(Object value, BindableType<?> clarifiedType)
validateback to summary
private void validate(Object value, TemporalType clarifiedTemporalType)