Package org.hibernate.procedure.internal
Class ProcedureParameterMetadataImpl
- java.lang.Object
-
- org.hibernate.procedure.internal.ProcedureParameterMetadataImpl
-
- All Implemented Interfaces:
ParameterMetadata
,ParameterMetadataImplementor
,ProcedureParameterMetadataImplementor
public class ProcedureParameterMetadataImpl extends Object implements ProcedureParameterMetadataImplementor
Specialized ParameterMetadataImplementor for callable queries implementing expandable parameter registrations
-
-
Constructor Summary
Constructors Constructor Description ProcedureParameterMetadataImpl()
ProcedureParameterMetadataImpl(NamedCallableQueryMemento memento, SharedSessionContractImplementor session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsReference(QueryParameter parameter)
Is this parameter reference registered in this collection?ProcedureParameterImplementor<?>
findQueryParameter(int positionLabel)
Find the QueryParameter registered under the given position-label, if one.ProcedureParameterImplementor<?>
findQueryParameter(String name)
Find the QueryParameter registered under the given name, if one.Set<String>
getNamedParameterNames()
Return the names of all named parameters of the query.Set<Integer>
getOrdinalParameterLabels()
int
getParameterCount()
The total number of registered parameters.ParameterStrategy
getParameterStrategy()
ProcedureParameterImplementor<?>
getQueryParameter(int positionLabel)
Get the QueryParameter reference registered here under the given position-label.ProcedureParameterImplementor<?>
getQueryParameter(String name)
Get the QueryParameter reference registered here under the given name.Set<? extends QueryParameter<?>>
getRegistrations()
List<? extends ProcedureParameterImplementor<?>>
getRegistrationsAsList()
boolean
hasAnyMatching(Predicate<QueryParameterImplementor<?>> filter)
boolean
hasNamedParameters()
Does this parameter set contain any named parameters?boolean
hasPositionalParameters()
Does this parameter set contain any positional parameters?void
registerParameter(ProcedureParameterImplementor parameter)
<P> ProcedureParameterImplementor<P>
resolve(jakarta.persistence.Parameter<P> param)
A deeper resolution attempt from a JPA parameter reference to Hibernate's contract.void
visitParameters(Consumer<QueryParameterImplementor<?>> consumer)
void
visitRegistrations(Consumer<? extends QueryParameter<?>> action)
General purpose visitation using functional-
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.ParameterMetadata
getInferredParameterType
-
Methods inherited from interface org.hibernate.query.spi.ParameterMetadataImplementor
collectAllParameters
-
-
-
-
Constructor Detail
-
ProcedureParameterMetadataImpl
public ProcedureParameterMetadataImpl()
-
ProcedureParameterMetadataImpl
public ProcedureParameterMetadataImpl(NamedCallableQueryMemento memento, SharedSessionContractImplementor session)
-
-
Method Detail
-
registerParameter
public void registerParameter(ProcedureParameterImplementor parameter)
-
visitParameters
public void visitParameters(Consumer<QueryParameterImplementor<?>> consumer)
- Specified by:
visitParameters
in interfaceParameterMetadataImplementor
-
hasNamedParameters
public boolean hasNamedParameters()
Description copied from interface:ParameterMetadata
Does this parameter set contain any named parameters?- Specified by:
hasNamedParameters
in interfaceParameterMetadata
- Returns:
true
if there are named parameters;false
otherwise.
-
hasPositionalParameters
public boolean hasPositionalParameters()
Description copied from interface:ParameterMetadata
Does this parameter set contain any positional parameters?- Specified by:
hasPositionalParameters
in interfaceParameterMetadata
- Returns:
true
if there are positional parameters;false
otherwise.
-
getNamedParameterNames
public Set<String> getNamedParameterNames()
Description copied from interface:ParameterMetadata
Return the names of all named parameters of the query.- Specified by:
getNamedParameterNames
in interfaceParameterMetadata
- Returns:
- the parameter names
-
getParameterCount
public int getParameterCount()
Description copied from interface:ParameterMetadata
The total number of registered parameters.- Specified by:
getParameterCount
in interfaceParameterMetadata
-
containsReference
public boolean containsReference(QueryParameter parameter)
Description copied from interface:ParameterMetadata
Is this parameter reference registered in this collection?- Specified by:
containsReference
in interfaceParameterMetadata
-
getParameterStrategy
public ParameterStrategy getParameterStrategy()
-
hasAnyMatching
public boolean hasAnyMatching(Predicate<QueryParameterImplementor<?>> filter)
- Specified by:
hasAnyMatching
in interfaceParameterMetadataImplementor
-
findQueryParameter
public ProcedureParameterImplementor<?> findQueryParameter(String name)
Description copied from interface:ParameterMetadata
Find the QueryParameter registered under the given name, if one.- Specified by:
findQueryParameter
in interfaceParameterMetadata
- Specified by:
findQueryParameter
in interfaceParameterMetadataImplementor
- Returns:
- The registered match, or
null
is there is no match - See Also:
ParameterMetadata.getQueryParameter(String)
-
getQueryParameter
public ProcedureParameterImplementor<?> getQueryParameter(String name)
Description copied from interface:ParameterMetadata
Get the QueryParameter reference registered here under the given name.- Specified by:
getQueryParameter
in interfaceParameterMetadata
- Specified by:
getQueryParameter
in interfaceParameterMetadataImplementor
- Returns:
- The registered match. Never
null
-
findQueryParameter
public ProcedureParameterImplementor<?> findQueryParameter(int positionLabel)
Description copied from interface:ParameterMetadata
Find the QueryParameter registered under the given position-label, if one.- Specified by:
findQueryParameter
in interfaceParameterMetadata
- Specified by:
findQueryParameter
in interfaceParameterMetadataImplementor
- Returns:
- The registered match, or
null
is there is no match - See Also:
ParameterMetadata.getQueryParameter(int)
-
getQueryParameter
public ProcedureParameterImplementor<?> getQueryParameter(int positionLabel)
Description copied from interface:ParameterMetadata
Get the QueryParameter reference registered here under the given position-label.- Specified by:
getQueryParameter
in interfaceParameterMetadata
- Specified by:
getQueryParameter
in interfaceParameterMetadataImplementor
- Returns:
- The registered match. Never
null
-
resolve
public <P> ProcedureParameterImplementor<P> resolve(jakarta.persistence.Parameter<P> param)
Description copied from interface:ParameterMetadata
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.- Specified by:
resolve
in interfaceParameterMetadata
- Specified by:
resolve
in interfaceParameterMetadataImplementor
-
getRegistrations
public Set<? extends QueryParameter<?>> getRegistrations()
- Specified by:
getRegistrations
in interfaceParameterMetadata
-
getRegistrationsAsList
public List<? extends ProcedureParameterImplementor<?>> getRegistrationsAsList()
- Specified by:
getRegistrationsAsList
in interfaceProcedureParameterMetadataImplementor
-
visitRegistrations
public void visitRegistrations(Consumer<? extends QueryParameter<?>> action)
Description copied from interface:ParameterMetadata
General purpose visitation using functional- Specified by:
visitRegistrations
in interfaceParameterMetadata
- Specified by:
visitRegistrations
in interfaceParameterMetadataImplementor
-
getOrdinalParameterLabels
public Set<Integer> getOrdinalParameterLabels()
- Specified by:
getOrdinalParameterLabels
in interfaceParameterMetadata
-
-