Package org.hibernate.jpa.spi
Interface ParameterRegistration<T>
-
- All Superinterfaces:
jakarta.persistence.Parameter<T>
- All Known Subinterfaces:
NullTypeBindableParameterRegistration<T>,StoredProcedureQueryParameterRegistration<T>
public interface ParameterRegistration<T> extends jakarta.persistence.Parameter<T>Hibernate specific extension to the JPAParametercontract as known to theQueryandStoredProcedureQueryimplementations. Used to track information known about the parameter.For parameter information as known to JPA criteria queries, see
JpaCriteriaParameterinstead.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbindValue(T value)If bindable, bind the value.voidbindValue(T value, jakarta.persistence.TemporalType specifiedTemporalType)If bindable, bind the value using the specific temporal type.ParameterBind<T>getBind()If bindable, get the current binding.jakarta.persistence.ParameterModegetMode()Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter? An OUTPUT parameter? etc).jakarta.persistence.QuerygetQuery()Access to the query that this parameter belongs to.booleanisBindable()Can we bind (set) values on this parameter? Generally this istrue, but would not be in the case of parameters with OUT or REF_CURSOR mode.booleanisJpaPositionalParameter()JPA has a different definition of positional parameters than what legacy Hibernate HQL had.
-
-
-
Method Detail
-
isJpaPositionalParameter
boolean isJpaPositionalParameter()
JPA has a different definition of positional parameters than what legacy Hibernate HQL had. In JPA, the parameter holders are labelled (named :/). At any rate the semantics are different and we often need to understand which we are dealing with (and applications might too).- Returns:
trueif this is a JPA-style ordinal parameter;falsewould indicate we have either a named parameter (Parameter.getName()would return a non-nullvalue) or a native Hibernate positional parameter.
-
getQuery
jakarta.persistence.Query getQuery()
Access to the query that this parameter belongs to.- Returns:
- The defining query
-
getMode
jakarta.persistence.ParameterMode getMode()
Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter? An OUTPUT parameter? etc).- Returns:
- The parameter mode.
-
isBindable
boolean isBindable()
Can we bind (set) values on this parameter? Generally this istrue, but would not be in the case of parameters with OUT or REF_CURSOR mode.- Returns:
- Whether the parameter is bindable (can set be called).
-
bindValue
void bindValue(T value)
If bindable, bind the value.- Parameters:
value- The value to bind.
-
bindValue
void bindValue(T value, jakarta.persistence.TemporalType specifiedTemporalType)
If bindable, bind the value using the specific temporal type.- Parameters:
value- The value to bindspecifiedTemporalType- The temporal type to use in binding
-
getBind
ParameterBind<T> getBind()
If bindable, get the current binding.- Returns:
- The current binding
-
-