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

public Class QueryParameterBindingsImpl

extends Object
implements QueryParameterBindings
Class Inheritance
All Implemented Interfaces
org.hibernate.query.spi.QueryParameterBindings
Annotations
@Incubating
Imports
java.util.ArrayList, .Arrays, .IdentityHashMap, .Iterator, .List, .Map, java.util.concurrent.ConcurrentHashMap, java.util.function.BiConsumer, org.hibernate.Incubating, .QueryParameterException, org.hibernate.cache.MutableCacheKeyBuilder, org.hibernate.cache.spi.QueryKey, org.hibernate.engine.spi.FilterDefinition, .LoadQueryInfluencers, .SessionFactoryImplementor, .SharedSessionContractImplementor, org.hibernate.internal.FilterImpl, org.hibernate.metamodel.mapping.JdbcMapping, .MappingModelExpressible, org.hibernate.query.BindableType, .QueryParameter, org.hibernate.query.spi.ParameterMetadataImplementor, .QueryParameterBinding, .QueryParameterBindings, .QueryParameterImplementor, org.hibernate.type.descriptor.java.JavaType, .JavaTypedExpressible, org.hibernate.type.spi.TypeConfiguration

Manages the group of QueryParameterBinding for a particular query.
Authors
Steve Ebersole, Chris Cranford

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private Map<QueryParameter<?>, QueryParameterBinding<?>>
private final ParameterMetadataImplementor
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Constructor Summary

AccessConstructor and Description
private
QueryParameterBindingsImpl(SessionFactoryImplementor sessionFactory, ParameterMetadataImplementor parameterMetadata)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
private MappingModelExpressible<?>
determineMappingType(final QueryParameterBinding<?> binding, final QueryParameter<?> queryParameter, final SharedSessionContractImplementor session)

public static QueryParameterBindingsImpl
from(ParameterMetadataImplementor parameterMetadata, SessionFactoryImplementor sessionFactory)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Constructs a QueryParameterBindings based on the passed information
public QueryKey.ParameterBindingsMemento
generateQueryKeyMemento(SharedSessionContractImplementor session)

Implements org.hibernate.query.spi.QueryParameterBindings.generateQueryKeyMemento.

Generate a "memento" for these parameter bindings that can be used in creating a QueryKey
public <P> QueryParameterBinding<P>
getBinding(QueryParameterImplementor<P>
The QueryParameter reference
parameter
)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via QueryParameter reference
public <P> QueryParameterBinding<P>
getBinding(int
The parameter position
position
)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via position
public <P> QueryParameterBinding<P>
getBinding(String
The parameter name
name
)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via name
public boolean
public boolean
isBound(QueryParameterImplementor<?>
The parameter to check for a binding
parameter
)

Implements org.hibernate.query.spi.QueryParameterBindings.isBound.

Has binding been done for the given parameter.
protected <T> QueryParameterBinding<T>
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

parameterBindingMapback to summary
private Map<QueryParameter<?>, QueryParameterBinding<?>> parameterBindingMap
parameterMetadataback to summary
private final ParameterMetadataImplementor parameterMetadata
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

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

Constructor Detail

QueryParameterBindingsImplback to summary
private QueryParameterBindingsImpl(SessionFactoryImplementor sessionFactory, ParameterMetadataImplementor parameterMetadata)

Deprecated

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

Method Detail

determineMappingTypeback to summary
private MappingModelExpressible<?> determineMappingType(final QueryParameterBinding<?> binding, final QueryParameter<?> queryParameter, final SharedSessionContractImplementor session)
fromback to summary
public static QueryParameterBindingsImpl from(ParameterMetadataImplementor parameterMetadata, SessionFactoryImplementor sessionFactory)

Deprecated

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

Constructs a QueryParameterBindings based on the passed information

generateQueryKeyMementoback to summary
public QueryKey.ParameterBindingsMemento generateQueryKeyMemento(SharedSessionContractImplementor session)

Implements org.hibernate.query.spi.QueryParameterBindings.generateQueryKeyMemento.

Doc from org.hibernate.query.spi.QueryParameterBindings.generateQueryKeyMemento.

Generate a "memento" for these parameter bindings that can be used in creating a QueryKey

Annotations
@Override
getBindingback to summary
public <P> QueryParameterBinding<P> getBinding(QueryParameterImplementor<P> parameter)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Doc from org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via QueryParameter reference

Parameters
parameter:QueryParameterImplementor<P>

The QueryParameter reference

Returns:QueryParameterBinding<P>

The binding, or null if not yet bound

Annotations
@Override
getBindingback to summary
public <P> QueryParameterBinding<P> getBinding(int position)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Doc from org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via position

Parameters
position:int

The parameter position

Returns:QueryParameterBinding<P>

The binding, or null if not yet bound

Annotations
@Override
getBindingback to summary
public <P> QueryParameterBinding<P> getBinding(String name)

Implements org.hibernate.query.spi.QueryParameterBindings.getBinding.

Doc from org.hibernate.query.spi.QueryParameterBindings.getBinding.

Access to the binding via name

Parameters
name:String

The parameter name

Returns:QueryParameterBinding<P>

The binding, or null if not yet bound

Annotations
@Override
hasAnyMultiValuedBindingsback to summary
public boolean hasAnyMultiValuedBindings()

Implements org.hibernate.query.spi.QueryParameterBindings.hasAnyMultiValuedBindings.

Annotations
@Override
isBoundback to summary
public boolean isBound(QueryParameterImplementor<?> parameter)

Implements org.hibernate.query.spi.QueryParameterBindings.isBound.

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

Has binding been done for the given parameter. Handles cases where we do not (yet) have a binding object as well by simply returning false.

Parameters
parameter:QueryParameterImplementor<?>

The parameter to check for a binding

Returns:boolean

true if its value has been bound; false otherwise.

Annotations
@Override
makeBindingback to summary
protected <T> QueryParameterBinding<T> makeBinding(QueryParameterImplementor<T> queryParameter)
validateback to summary
public void validate()

Implements org.hibernate.query.spi.QueryParameterBindings.validate.

Doc from org.hibernate.query.spi.QueryParameterBindings.validate.

Validate the bindings. Called just before execution

Annotations
@Override
visitBindingsback to summary
public void visitBindings(BiConsumer<T, U> action)

Implements org.hibernate.query.spi.QueryParameterBindings.visitBindings.

Annotations
@Override
org.hibernate.query.internal back to summary

private Class QueryParameterBindingsImpl.MutableCacheKeyImpl

extends Object
implements MutableCacheKeyBuilder
Class Inheritance
  • java.lang.Object
  • org.hibernate.query.internal.QueryParameterBindingsImpl.MutableCacheKeyImpl
All Implemented Interfaces
org.hibernate.cache.MutableCacheKeyBuilder, java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv int
pack-priv final List<Object>

Constructor Summary

AccessConstructor and Description
public
MutableCacheKeyImpl(int parameterBindingMapSize)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public QueryKey.ParameterBindingsMemento
build()

Implements org.hibernate.cache.MutableCacheKeyBuilder.build.

creates an Object to be used as a key into the query results cache.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hashCodeback to summary
pack-priv int hashCode
valuesback to summary
pack-priv final List<Object> values

Constructor Detail

MutableCacheKeyImplback to summary
public MutableCacheKeyImpl(int parameterBindingMapSize)

Method Detail

addHashCodeback to summary
public void addHashCode(int hashCode)

Implements org.hibernate.cache.MutableCacheKeyBuilder.addHashCode.

Annotations
@Override
addValueback to summary
public void addValue(Object value)

Implements org.hibernate.cache.MutableCacheKeyBuilder.addValue.

Annotations
@Override
buildback to summary
public QueryKey.ParameterBindingsMemento build()

Implements org.hibernate.cache.MutableCacheKeyBuilder.build.

Doc from org.hibernate.cache.MutableCacheKeyBuilder.build.

creates an Object to be used as a key into the query results cache.

Annotations
@Override
org.hibernate.query.internal back to summary

private Class QueryParameterBindingsImpl.ParameterBindingsMementoImpl

extends Object
implements ParameterBindingsMemento
Class Inheritance
  • java.lang.Object
  • org.hibernate.query.internal.QueryParameterBindingsImpl.ParameterBindingsMementoImpl
All Implemented Interfaces
org.hibernate.cache.spi.QueryKey.ParameterBindingsMemento, java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final Object[]

Constructor Summary

AccessConstructor and Description
private
ParameterBindingsMementoImpl(Object[] values, int hashCode)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

hashCodeback to summary
pack-priv final int hashCode
valuesback to summary
pack-priv final Object[] values

Constructor Detail

ParameterBindingsMementoImplback to summary
private ParameterBindingsMementoImpl(Object[] values, int hashCode)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override