Class StaticTypedQueryReference<R>
java.lang.Object
jakarta.persistence.query.StaticTypedQueryReference<R>
- Type Parameters:
R- The result type of the query
- All Implemented Interfaces:
Reference, TypedQueryReference<R>
A reference to a query declared using a
JakartaQuery
or NativeQuery annotation. An instance of this
class is usually instantiated by a generated method of the
static metamodel for the annotated program element.- Since:
- 4.0
-
Constructor Summary
ConstructorsConstructorDescriptionStaticTypedQueryReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, Class<R> resultType, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments) Intended for use in code generated by an annotation processor.StaticTypedQueryReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, Class<R> resultType, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments, String entityGraphName, Map<String, Object> hints, TypedQuery.Option... options) Intended for use in code generated by an annotation processor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanClass<?> The arguments supplied to the parameters of the statement or query, ornullif no arguments were supplied.The specified entity graph name, if any, ornullif no entity graph was specified.getHints()A map keyed by hint name of all hints specified viaNamedQuery.hints(),NamedNativeQuery.hints(), orQueryOptions.hints().getName()The name of the statement or query, as specified byNamedQuery.name()orNamedNativeQuery.name(), or as inferred from the name of the method annotatedJakartaQueryorNativeQuery.All options specified byQueryOptions,NamedQuery, orNamedNativeQuery, or an empty set if no options were specified.The names assigned to the supplied arguments to parameters of the statement or query, ornullif no arguments were supplied.The types of the supplied arguments to parameters of the statement or query, ornullif no arguments were supplied.The result type of the query, as specified byNamedQuery.resultClass()orNamedNativeQuery.resultClass(), or as inferred from the declared return type of the method annotatedJakartaQueryorNativeQuery.inthashCode()toString()
-
Constructor Details
-
StaticTypedQueryReference
public StaticTypedQueryReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, Class<R> resultType, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments, String entityGraphName, Map<String, Object> hints, TypedQuery.Option... options) Intended for use in code generated by an annotation processor. This constructor overload is adapted to the case where the program element is annotated withQueryOptions.- Parameters:
queryName- The name of the query, the concatenation of the unqualified name of the annotated type, with the string".", and the name of the annotated memberannotatedClass- The annotated classannotatedMemberName- The name of the annotated memberresultType- The result type of the query, the type of the annotated memberparameterTypes- The types of the parameters of the annotated memberparameterNames- The names of the parameters of the annotated memberarguments- The arguments supplied to the parameters at runtimeentityGraphName- SeeQueryOptions.entityGraph()hints- SeeQueryOptions.hints()options- All specified options
-
StaticTypedQueryReference
public StaticTypedQueryReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, Class<R> resultType, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments) Intended for use in code generated by an annotation processor. This constructor overload is adapted to the case where the program element is not annotated withQueryOptions.- Parameters:
queryName- The name of the query, the concatenation of the unqualified name of the annotated type, with the string".", and the name of the annotated memberannotatedClass- The annotated classannotatedMemberName- The name of the annotated memberresultType- The result type of the query, the type of the annotated memberparameterTypes- The types of the parameters of the annotated memberparameterNames- The names of the parameters of the annotated memberarguments- The arguments supplied to the parameters at runtime
-
-
Method Details
-
getName
Description copied from interface:ReferenceThe name of the statement or query, as specified byNamedQuery.name()orNamedNativeQuery.name(), or as inferred from the name of the method annotatedJakartaQueryorNativeQuery. -
getResultType
Description copied from interface:TypedQueryReferenceThe result type of the query, as specified byNamedQuery.resultClass()orNamedNativeQuery.resultClass(), or as inferred from the declared return type of the method annotatedJakartaQueryorNativeQuery.- Specified by:
getResultTypein interfaceTypedQueryReference<R>
-
getHints
Description copied from interface:ReferenceA map keyed by hint name of all hints specified viaNamedQuery.hints(),NamedNativeQuery.hints(), orQueryOptions.hints().Any attempted mutation of the returned map results in an
UnsupportedOperationException. -
getParameterTypes
Description copied from interface:ReferenceThe types of the supplied arguments to parameters of the statement or query, ornullif no arguments were supplied. Arguments are present when this is a reference to a statement or query declared using an annotation of a method.Any mutation of the returned list results in an
UnsupportedOperationException.- Specified by:
getParameterTypesin interfaceReference
-
getParameterNames
Description copied from interface:ReferenceThe names assigned to the supplied arguments to parameters of the statement or query, ornullif no arguments were supplied. Arguments are present when this is a reference to a statement or query declared using an annotation of a method. If the query has named parameters, these are interpreted as the parameter names. Otherwise, if the query has positional parameters, they are ignored.Any mutation of the returned list results in an
UnsupportedOperationException.- Specified by:
getParameterNamesin interfaceReference
-
getArguments
Description copied from interface:ReferenceThe arguments supplied to the parameters of the statement or query, ornullif no arguments were supplied. Arguments are present when this is a reference to a query declared using an annotation of a method.- If the query has ordinal parameters, the position of an argument in this array determines its assignment to a parameter.
- If the query has named parameters, this array is aligned elementwise with the array of parameter names to obtain an assignment of arguments to parameters.
Any mutation of the returned list results in an
UnsupportedOperationException.- Specified by:
getArgumentsin interfaceReference- See Also:
-
getAnnotatedClass
-
getAnnotatedMemberName
-
getEntityGraphName
Description copied from interface:TypedQueryReferenceThe specified entity graph name, if any, ornullif no entity graph was specified.- Specified by:
getEntityGraphNamein interfaceTypedQueryReference<R>- See Also:
-
getOptions
Description copied from interface:TypedQueryReferenceAll options specified byQueryOptions,NamedQuery, orNamedNativeQuery, or an empty set if no options were specified.- Specified by:
getOptionsin interfaceTypedQueryReference<R>- See Also:
-
equals
-
hashCode
-
toString
-