Package org.hibernate.query.spi
Interface QueryParameterBindings
-
- All Known Implementing Classes:
ProcedureParamBindings
,QueryParameterBindingsImpl
@Incubating public interface QueryParameterBindings
Manages all the parameter bindings for a particular query.
-
-
Field Summary
Fields Modifier and Type Field Description static QueryParameterBindings
NO_PARAM_BINDINGS
Deprecated, for removal: This API element is subject to removal in a future version.Useempty()
instead.static QueryKey.ParameterBindingsMemento
NO_PARAMETER_BINDING_MEMENTO
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static QueryParameterBindings
empty()
QueryKey.ParameterBindingsMemento
generateQueryKeyMemento(SharedSessionContractImplementor persistenceContext)
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 namedefault <P> QueryParameterBinding<P>
getBinding(QueryParameter<P> parameter)
Access to the binding via QueryParameter reference<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.void
validate()
Validate the bindings.void
visitBindings(BiConsumer<QueryParameterImplementor<?>,QueryParameterBinding<?>> action)
-
-
-
Field Detail
-
NO_PARAMETER_BINDING_MEMENTO
static final QueryKey.ParameterBindingsMemento NO_PARAMETER_BINDING_MEMENTO
-
NO_PARAM_BINDINGS
@Deprecated(forRemoval=true, since="6.6") static final QueryParameterBindings NO_PARAM_BINDINGS
Deprecated, for removal: This API element is subject to removal in a future version.Useempty()
instead.
-
-
Method Detail
-
isBound
boolean isBound(QueryParameterImplementor<?> parameter)
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
- The parameter to check for a binding- Returns:
true
if its value has been bound;false
otherwise.
-
getBinding
default <P> QueryParameterBinding<P> getBinding(QueryParameter<P> parameter)
Access to the binding via QueryParameter reference- Parameters:
parameter
- The QueryParameter reference- Returns:
- The binding, or
null
if not yet bound
-
getBinding
<P> QueryParameterBinding<P> getBinding(QueryParameterImplementor<P> parameter)
Access to the binding via QueryParameter reference- Parameters:
parameter
- The QueryParameter reference- Returns:
- The binding, or
null
if not yet bound
-
getBinding
<P> QueryParameterBinding<P> getBinding(String name)
Access to the binding via name- Parameters:
name
- The parameter name- Returns:
- The binding, or
null
if not yet bound
-
getBinding
<P> QueryParameterBinding<P> getBinding(int position)
Access to the binding via position- Parameters:
position
- The parameter position- Returns:
- The binding, or
null
if not yet bound
-
validate
void validate()
Validate the bindings. Called just before execution
-
hasAnyMultiValuedBindings
boolean hasAnyMultiValuedBindings()
-
generateQueryKeyMemento
QueryKey.ParameterBindingsMemento generateQueryKeyMemento(SharedSessionContractImplementor persistenceContext)
Generate a "memento" for these parameter bindings that can be used in creating aQueryKey
-
visitBindings
void visitBindings(BiConsumer<QueryParameterImplementor<?>,QueryParameterBinding<?>> action)
-
empty
static QueryParameterBindings empty()
-
-