Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@


/**
* Access to known information about the parameters for a query.
* Information about the {@linkplain QueryParameter parameters}
* of a {@linkplain CommonQueryContract query}.
*
* @author Steve Ebersole
*
* @see CommonQueryContract#getParameterMetadata()
*/
@Incubating
public interface ParameterMetadata {
Expand All @@ -36,7 +39,8 @@ public interface ParameterMetadata {
int getParameterCount();

/**
* Find the QueryParameter registered under the given name, if one.
* Find the {@linkplain QueryParameter parameter reference} registered
* under the given name, if there is one.
*
* @return The registered match, or {@code null} is there is no match
*
Expand All @@ -45,16 +49,18 @@ public interface ParameterMetadata {
QueryParameter<?> findQueryParameter(String name);

/**
* Get the QueryParameter reference registered here under the given name.
* Get the {@linkplain QueryParameter parameter reference} registered
* under the given name.
*
* @return The registered match. Never {@code null}
* @return The registered match. Never {@code null}
*
* @throws IllegalArgumentException if no parameter is registered under that name
*/
QueryParameter<?> getQueryParameter(String name);

/**
* Find the QueryParameter registered under the given position-label, if one.
* Find the {@linkplain QueryParameter parameter reference} registered
* at the given position-label, if there is one.
*
* @return The registered match, or {@code null} is there is no match
*
Expand All @@ -63,23 +69,27 @@ public interface ParameterMetadata {
QueryParameter<?> findQueryParameter(int positionLabel);

/**
* Get the QueryParameter reference registered here under the given position-label.
* Get the {@linkplain QueryParameter parameter reference} registered
* at the given position-label.
*
* @return The registered match. Never {@code null}
* @return The registered match. Never {@code null}
*
* @throws IllegalArgumentException if no parameter is registered under that position-label
*/
QueryParameter<?> getQueryParameter(int positionLabel);

/**
* A deeper resolution attempt from a JPA parameter reference to Hibernate's
* contract. Generally should return the same param reference.
* Obtain a {@link QueryParameter} representing the same parameter as the
* given JPA-standard {@link Parameter}.
*
* According to the spec, only Parameter references obtained from the provider
* are valid.
* @apiNote According to the spec, only {@link Parameter} references obtained
* from the provider are valid.
*/
<P> QueryParameter<P> resolve(Parameter<P> param);

/**
* Get the type of the given parameter.
*/
<T> BindableType<T> getInferredParameterType(QueryParameter<T> parameter);

/**
Expand Down Expand Up @@ -123,5 +133,10 @@ public interface ParameterMetadata {
*/
boolean hasPositionalParameters();

/**
* Get the position labels of all positional parameters.
*
* @return the position labels
*/
Set<Integer> getOrdinalParameterLabels();
}
Loading