Package org.hibernate.query.internal
Class ParameterMetadataImpl
java.lang.Object
org.hibernate.query.internal.ParameterMetadataImpl
- All Implemented Interfaces:
ParameterMetadata,ParameterMetadataImplementor
Encapsulates metadata about parameters encountered within a query.
- Author:
- Steve Ebersole
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParameterMetadataImpl(Map<Integer, QueryParameterImplementor<?>> positionalQueryParameters, Map<String, QueryParameterImplementor<?>> namedQueryParameters) ParameterMetadataImpl(Map<QueryParameterImplementor<?>, List<SqmParameter<?>>> queryParameters) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsReference(QueryParameter<?> parameter) Is this parameter reference registered in this collection?createBindings(SessionFactoryImplementor sessionFactory) findQueryParameter(int positionLabel) Find the QueryParameter registered under the given position-label, if one.findQueryParameter(String name) Find the QueryParameter registered under the given name, if one.<T> BindableType<T>getInferredParameterType(QueryParameter<T> parameter) Return the names of all named parameters of the query.intThe total number of registered parameters.getQueryParameter(int positionLabel) Get the QueryParameter reference registered here under the given position-label.getQueryParameter(String name) Get the QueryParameter reference registered here under the given name.booleanhasAnyMatching(Predicate<QueryParameterImplementor<?>> filter) booleanDoes this parameter set contain any named parameters?booleanDoes this parameter set contain any positional parameters?<P> QueryParameterImplementor<P>A deeper resolution attempt from a JPA parameter reference to Hibernate's contract.voidvisitParameters(Consumer<QueryParameterImplementor<?>> consumer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.query.spi.ParameterMetadataImplementor
collectAllParameters, visitRegistrations
-
Field Details
-
EMPTY
Singleton access
-
-
Constructor Details
-
ParameterMetadataImpl
public ParameterMetadataImpl(Map<QueryParameterImplementor<?>, List<SqmParameter<?>>> queryParameters) -
ParameterMetadataImpl
public ParameterMetadataImpl(Map<Integer, QueryParameterImplementor<?>> positionalQueryParameters, Map<String, QueryParameterImplementor<?>> namedQueryParameters)
-
-
Method Details
-
createBindings
- Specified by:
createBindingsin interfaceParameterMetadataImplementor
-
getParameterCount
public int getParameterCount()Description copied from interface:ParameterMetadataThe total number of registered parameters.- Specified by:
getParameterCountin interfaceParameterMetadata
-
getInferredParameterType
- Specified by:
getInferredParameterTypein interfaceParameterMetadata
-
containsReference
Description copied from interface:ParameterMetadataIs this parameter reference registered in this collection?- Specified by:
containsReferencein interfaceParameterMetadata
-
visitParameters
- Specified by:
visitParametersin interfaceParameterMetadataImplementor
-
getRegistrations
- Specified by:
getRegistrationsin interfaceParameterMetadata
-
hasAnyMatching
- Specified by:
hasAnyMatchingin interfaceParameterMetadataImplementor
-
resolve
Description copied from interface:ParameterMetadataA 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:
resolvein interfaceParameterMetadata- Specified by:
resolvein interfaceParameterMetadataImplementor
-
hasNamedParameters
public boolean hasNamedParameters()Description copied from interface:ParameterMetadataDoes this parameter set contain any named parameters?- Specified by:
hasNamedParametersin interfaceParameterMetadata- Returns:
trueif there are named parameters;falseotherwise.
-
getNamedParameterNames
Description copied from interface:ParameterMetadataReturn the names of all named parameters of the query.- Specified by:
getNamedParameterNamesin interfaceParameterMetadata- Returns:
- the parameter names
-
findQueryParameter
Description copied from interface:ParameterMetadataFind the QueryParameter registered under the given name, if one.- Specified by:
findQueryParameterin interfaceParameterMetadata- Specified by:
findQueryParameterin interfaceParameterMetadataImplementor- Returns:
- The registered match, or
nullis there is no match - See Also:
-
getQueryParameter
Description copied from interface:ParameterMetadataGet the QueryParameter reference registered here under the given name.- Specified by:
getQueryParameterin interfaceParameterMetadata- Specified by:
getQueryParameterin interfaceParameterMetadataImplementor- Returns:
- The registered match. Never
null
-
hasPositionalParameters
public boolean hasPositionalParameters()Description copied from interface:ParameterMetadataDoes this parameter set contain any positional parameters?- Specified by:
hasPositionalParametersin interfaceParameterMetadata- Returns:
trueif there are positional parameters;falseotherwise.
-
getOrdinalParameterLabels
- Specified by:
getOrdinalParameterLabelsin interfaceParameterMetadata
-
findQueryParameter
Description copied from interface:ParameterMetadataFind the QueryParameter registered under the given position-label, if one.- Specified by:
findQueryParameterin interfaceParameterMetadata- Specified by:
findQueryParameterin interfaceParameterMetadataImplementor- Returns:
- The registered match, or
nullis there is no match - See Also:
-
getQueryParameter
Description copied from interface:ParameterMetadataGet the QueryParameter reference registered here under the given position-label.- Specified by:
getQueryParameterin interfaceParameterMetadata- Specified by:
getQueryParameterin interfaceParameterMetadataImplementor- Returns:
- The registered match. Never
null
-