Package org.hibernate.query.internal
Class QueryParameterBindingsImpl
- java.lang.Object
-
- org.hibernate.query.internal.QueryParameterBindingsImpl
-
- All Implemented Interfaces:
QueryParameterBindings
@Incubating public class QueryParameterBindingsImpl extends Object implements QueryParameterBindings
Manages the group of QueryParameterBinding for a particular query.
-
-
Field Summary
-
Fields inherited from interface org.hibernate.query.spi.QueryParameterBindings
NO_PARAM_BINDINGS, NO_PARAMETER_BINDING_MEMENTO
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryParameterBindingsImpl
from(ParameterMetadataImplementor parameterMetadata, SessionFactoryImplementor sessionFactory)
Constructs a QueryParameterBindings based on the passed informationQueryKey.ParameterBindingsMemento
generateQueryKeyMemento(SharedSessionContractImplementor session)
Generate a "memento" for these parameter bindings that can be used in creating aQueryKey
<P> QueryParameterBinding<P>
getBinding(int position)
Access to the binding via position<P> QueryParameterBinding<P>
getBinding(String name)
Access to the binding via name<P> QueryParameterBinding<P>
getBinding(QueryParameterImplementor<P> parameter)
Access to the binding via QueryParameter referenceboolean
hasAnyMultiValuedBindings()
boolean
isBound(QueryParameterImplementor<?> parameter)
Has binding been done for the given parameter.protected <T> QueryParameterBinding<T>
makeBinding(QueryParameterImplementor<T> queryParameter)
void
validate()
Validate the bindings.void
visitBindings(BiConsumer action)
-
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.QueryParameterBindings
getBinding
-
-
-
-
Method Detail
-
from
public static QueryParameterBindingsImpl from(ParameterMetadataImplementor parameterMetadata, SessionFactoryImplementor sessionFactory)
Constructs a QueryParameterBindings based on the passed information
-
makeBinding
protected <T> QueryParameterBinding<T> makeBinding(QueryParameterImplementor<T> queryParameter)
-
isBound
public boolean isBound(QueryParameterImplementor<?> parameter)
Description copied from interface:QueryParameterBindings
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.- Specified by:
isBound
in interfaceQueryParameterBindings
- Parameters:
parameter
- The parameter to check for a binding- Returns:
true
if its value has been bound;false
otherwise.
-
getBinding
public <P> QueryParameterBinding<P> getBinding(QueryParameterImplementor<P> parameter)
Description copied from interface:QueryParameterBindings
Access to the binding via QueryParameter reference- Specified by:
getBinding
in interfaceQueryParameterBindings
- Parameters:
parameter
- The QueryParameter reference- Returns:
- The binding, or
null
if not yet bound
-
getBinding
public <P> QueryParameterBinding<P> getBinding(int position)
Description copied from interface:QueryParameterBindings
Access to the binding via position- Specified by:
getBinding
in interfaceQueryParameterBindings
- Parameters:
position
- The parameter position- Returns:
- The binding, or
null
if not yet bound
-
getBinding
public <P> QueryParameterBinding<P> getBinding(String name)
Description copied from interface:QueryParameterBindings
Access to the binding via name- Specified by:
getBinding
in interfaceQueryParameterBindings
- Parameters:
name
- The parameter name- Returns:
- The binding, or
null
if not yet bound
-
validate
public void validate()
Description copied from interface:QueryParameterBindings
Validate the bindings. Called just before execution- Specified by:
validate
in interfaceQueryParameterBindings
-
hasAnyMultiValuedBindings
public boolean hasAnyMultiValuedBindings()
- Specified by:
hasAnyMultiValuedBindings
in interfaceQueryParameterBindings
-
visitBindings
public void visitBindings(BiConsumer action)
- Specified by:
visitBindings
in interfaceQueryParameterBindings
-
generateQueryKeyMemento
public QueryKey.ParameterBindingsMemento generateQueryKeyMemento(SharedSessionContractImplementor session)
Description copied from interface:QueryParameterBindings
Generate a "memento" for these parameter bindings that can be used in creating aQueryKey
- Specified by:
generateQueryKeyMemento
in interfaceQueryParameterBindings
-
-