Package org.hibernate.query
Interface ParameterMetadata
-
- All Known Subinterfaces:
ParameterMetadataImplementor
,ProcedureParameterMetadataImplementor
- All Known Implementing Classes:
ParameterMetadataImpl
,ProcedureParameterMetadataImpl
public interface ParameterMetadata
Access to known information about the parameters for a query.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
containsReference(QueryParameter<?> parameter)
Is this parameter reference registered in this collection?QueryParameter<?>
findQueryParameter(int positionLabel)
Find the QueryParameter registered under the given position-label, if one.QueryParameter<?>
findQueryParameter(String name)
Find the QueryParameter registered under the given name, if one.default <T> BindableType<T>
getInferredParameterType(QueryParameter<T> parameter)
Set<String>
getNamedParameterNames()
Return the names of all named parameters of the query.Set<Integer>
getOrdinalParameterLabels()
int
getParameterCount()
The total number of registered parameters.QueryParameter<?>
getQueryParameter(int positionLabel)
Get the QueryParameter reference registered here under the given position-label.QueryParameter<?>
getQueryParameter(String name)
Get the QueryParameter reference registered here under the given name.Set<? extends QueryParameter<?>>
getRegistrations()
boolean
hasNamedParameters()
Does this parameter set contain any named parameters?boolean
hasPositionalParameters()
Does this parameter set contain any positional parameters?<P> QueryParameter<P>
resolve(jakarta.persistence.Parameter<P> param)
A deeper resolution attempt from a JPA parameter reference to Hibernate's contract.void
visitRegistrations(Consumer<? extends QueryParameter<?>> action)
General purpose visitation using functional
-
-
-
Method Detail
-
getParameterCount
int getParameterCount()
The total number of registered parameters.
-
findQueryParameter
QueryParameter<?> findQueryParameter(String name)
Find the QueryParameter registered under the given name, if one.- Returns:
- The registered match, or
null
is there is no match - See Also:
getQueryParameter(String)
-
getQueryParameter
QueryParameter<?> getQueryParameter(String name)
Get the QueryParameter reference registered here under the given name.- Returns:
- The registered match. Never
null
- Throws:
IllegalArgumentException
- if no parameter is registered under that name
-
findQueryParameter
QueryParameter<?> findQueryParameter(int positionLabel)
Find the QueryParameter registered under the given position-label, if one.- Returns:
- The registered match, or
null
is there is no match - See Also:
getQueryParameter(int)
-
getQueryParameter
QueryParameter<?> getQueryParameter(int positionLabel)
Get the QueryParameter reference registered here under the given position-label.- Returns:
- The registered match. Never
null
- Throws:
IllegalArgumentException
- if no parameter is registered under that position-label
-
resolve
<P> QueryParameter<P> resolve(jakarta.persistence.Parameter<P> param)
A deeper resolution attempt from a JPA parameter reference to Hibernate's contract. Generally should return the same param reference. According to the spec, only Parameter references obtained from the provider are valid.
-
getInferredParameterType
default <T> BindableType<T> getInferredParameterType(QueryParameter<T> parameter)
-
containsReference
boolean containsReference(QueryParameter<?> parameter)
Is this parameter reference registered in this collection?
-
getRegistrations
Set<? extends QueryParameter<?>> getRegistrations()
-
visitRegistrations
void visitRegistrations(Consumer<? extends QueryParameter<?>> action)
General purpose visitation using functional
-
hasNamedParameters
boolean hasNamedParameters()
Does this parameter set contain any named parameters?- Returns:
true
if there are named parameters;false
otherwise.
-
getNamedParameterNames
Set<String> getNamedParameterNames()
Return the names of all named parameters of the query.- Returns:
- the parameter names
-
hasPositionalParameters
boolean hasPositionalParameters()
Does this parameter set contain any positional parameters?- Returns:
true
if there are positional parameters;false
otherwise.
-
-