Top Description Fields Constructors Methods
org.hibernate.query.internal

public Class ParameterMetadataImpl

extends Object
implements ParameterMetadata
Class Inheritance
All Implemented Interfaces
org.hibernate.query.ParameterMetadata
Imports
java.util.ArrayList, .Collection, .Collections, .HashSet, .List, .Locale, .Map, .Set, java.util.function.Consumer, javax.persistence.Parameter, org.hibernate.QueryException, .QueryParameterException, org.hibernate.engine.query.spi.NamedParameterDescriptor, .OrdinalParameterDescriptor, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.compare.ComparableComparator, org.hibernate.query.ParameterMetadata, .QueryParameter, org.hibernate.type.Type

Encapsulates metadata about parameters encountered within a query.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final Map<String, NamedParameterDescriptor>
private final Set<QueryParameter<T>>
private final Map<Integer, OrdinalParameterDescriptor>
private final Set<QueryParameter<T>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Set<QueryParameter<?>>
public Set<Parameter<?>>
public boolean
public NamedParameterDescriptor

Returns:

The named parameter descriptor
getNamedParameterDescriptor
(String
The name of the parameter to locate
name
)

Get the descriptor for a named parameter given the name

public Type

Returns:

The type
getNamedParameterExpectedType
(String
The name of the parameter
name
)

Deprecated.
public Set<String>
getNamedParameterNames()

Implements org.hibernate.query.ParameterMetadata.getNamedParameterNames.

Return the names of all named parameters of the query.
public Collection<QueryParameter<T>>
public int[]

Returns:

The type
getNamedParameterSourceLocations
(String
The name of the parameter
name
)

Deprecated.
public int
public OrdinalParameterDescriptor

Returns:

The ordinal parameter descriptor
getOrdinalParameterDescriptor
(int
The position (0 based)
position
)

Get the descriptor for an ordinal parameter given its position

public Type

Returns:

The type
getOrdinalParameterExpectedType
(int
The position
position
)

Deprecated.
public Set<Integer>
public int

Returns:

The source location
getOrdinalParameterSourceLocation
(int
The position
position
)

Deprecated.
public int
public int
public Collection<QueryParameter<T>>
public <T> QueryParameter<T>
public <T> QueryParameter<T>
public boolean
hasNamedParameters()

Implements org.hibernate.query.ParameterMetadata.hasNamedParameters.

Does this parameter set contain any named parameters?
public boolean
hasPositionalParameters()

Implements org.hibernate.query.ParameterMetadata.hasPositionalParameters.

Does this parameter set contain any positional parameters?
public <T> QueryParameter<T>
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

namedDescriptorMapback to summary
private final Map<String, NamedParameterDescriptor> namedDescriptorMap
namedDescriptorValueCacheback to summary
private final Set<QueryParameter<T>> namedDescriptorValueCache
ordinalDescriptorMapback to summary
private final Map<Integer, OrdinalParameterDescriptor> ordinalDescriptorMap
ordinalDescriptorValueCacheback to summary
private final Set<QueryParameter<T>> ordinalDescriptorValueCache

Constructor Detail

ParameterMetadataImplback to summary
public ParameterMetadataImpl(Map<Integer, OrdinalParameterDescriptor> ordinalDescriptorMap, Map<String, NamedParameterDescriptor> namedDescriptorMap)

Method Detail

collectAllParametersback to summary
public Set<QueryParameter<?>> collectAllParameters()

Implements org.hibernate.query.ParameterMetadata.collectAllParameters.

Annotations
@Override
@SuppressWarnings:unchecked
collectAllParametersJpaback to summary
public Set<Parameter<?>> collectAllParametersJpa()

Implements org.hibernate.query.ParameterMetadata.collectAllParametersJpa.

Annotations
@Override
@SuppressWarnings:unchecked
containsReferenceback to summary
public boolean containsReference(QueryParameter<T> parameter)

Implements org.hibernate.query.ParameterMetadata.containsReference.

Annotations
@Override
@SuppressWarnings:SuspiciousMethodCalls
getNamedParameterDescriptorback to summary
public NamedParameterDescriptor getNamedParameterDescriptor(String name)

Get the descriptor for a named parameter given the name

Parameters
name:String

The name of the parameter to locate

Returns:NamedParameterDescriptor

The named parameter descriptor

Exceptions
QueryParameterException:
If the name could not be resolved to a named parameter
getNamedParameterExpectedTypeback to summary
public Type getNamedParameterExpectedType(String name)

Deprecated.

Parameters
name:String

The name of the parameter

Returns:Type

The type

Annotations
@Deprecated
getNamedParameterNamesback to summary
public Set<String> getNamedParameterNames()

Implements org.hibernate.query.ParameterMetadata.getNamedParameterNames.

Doc from org.hibernate.query.ParameterMetadata.getNamedParameterNames.

Return the names of all named parameters of the query.

Returns:Set<String>

the parameter names, in no particular order

Annotations
@Override
getNamedParametersback to summary
public Collection<QueryParameter<T>> getNamedParameters()

Implements org.hibernate.query.ParameterMetadata.getNamedParameters.

Annotations
@Override
getNamedParameterSourceLocationsback to summary
public int[] getNamedParameterSourceLocations(String name)

Deprecated.

Parameters
name:String

The name of the parameter

Returns:int[]

The type

Annotations
@Deprecated
getOrdinalParameterCountback to summary
public int getOrdinalParameterCount()
getOrdinalParameterDescriptorback to summary
public OrdinalParameterDescriptor getOrdinalParameterDescriptor(int position)

Get the descriptor for an ordinal parameter given its position

Parameters
position:int

The position (0 based)

Returns:OrdinalParameterDescriptor

The ordinal parameter descriptor

Exceptions
QueryParameterException:
If the position is out of range
getOrdinalParameterExpectedTypeback to summary
public Type getOrdinalParameterExpectedType(int position)

Deprecated.

Parameters
position:int

The position

Returns:Type

The type

Annotations
@Deprecated
getOrdinalParameterLabelsback to summary
public Set<Integer> getOrdinalParameterLabels()
getOrdinalParameterSourceLocationback to summary
public int getOrdinalParameterSourceLocation(int position)

Deprecated.

Parameters
position:int

The position

Returns:int

The source location

Annotations
@Deprecated
getParameterCountback to summary
public int getParameterCount()

Implements org.hibernate.query.ParameterMetadata.getParameterCount.

Annotations
@Override
getPositionalParameterCountback to summary
public int getPositionalParameterCount()

Implements org.hibernate.query.ParameterMetadata.getPositionalParameterCount.

Doc from org.hibernate.query.ParameterMetadata.getPositionalParameterCount.

Returns the number of positional parameters.

Returns:int

The number of positional parameters.

Annotations
@Override
getPositionalParametersback to summary
public Collection<QueryParameter<T>> getPositionalParameters()

Implements org.hibernate.query.ParameterMetadata.getPositionalParameters.

Annotations
@Override
getQueryParameterback to summary
public <T> QueryParameter<T> getQueryParameter(String name)

Implements org.hibernate.query.ParameterMetadata.getQueryParameter.

Annotations
@Override
getQueryParameterback to summary
public <T> QueryParameter<T> getQueryParameter(Integer position)

Implements org.hibernate.query.ParameterMetadata.getQueryParameter.

Annotations
@Override
@SuppressWarnings:unchecked
hasNamedParametersback to summary
public boolean hasNamedParameters()

Implements org.hibernate.query.ParameterMetadata.hasNamedParameters.

Doc from org.hibernate.query.ParameterMetadata.hasNamedParameters.

Does this parameter set contain any named parameters?

Returns:boolean

true if there are named parameters; false otherwise.

Annotations
@Override
hasPositionalParametersback to summary
public boolean hasPositionalParameters()

Implements org.hibernate.query.ParameterMetadata.hasPositionalParameters.

Doc from org.hibernate.query.ParameterMetadata.hasPositionalParameters.

Does this parameter set contain any positional parameters?

Returns:boolean

true if there are positional parameters; false otherwise.

Annotations
@Override
resolveback to summary
public <T> QueryParameter<T> resolve(Parameter<T> param)

Implements org.hibernate.query.ParameterMetadata.resolve.

Annotations
@Override
visitRegistrationsback to summary
public void visitRegistrations(Consumer<QueryParameter<T>> action)

Implements org.hibernate.query.ParameterMetadata.visitRegistrations.

Annotations
@Override