Class StaticStatementReference
java.lang.Object
jakarta.persistence.query.StaticStatementReference
- All Implemented Interfaces:
Reference, StatementReference
A reference to a statement 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
ConstructorsConstructorDescriptionStaticStatementReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments) Intended for use in code generated by an annotation processor.StaticStatementReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments, Map<String, Object> hints, Statement.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.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.inthashCode()toString()
-
Constructor Details
-
StaticStatementReference
public StaticStatementReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, List<Class<?>> parameterTypes, List<String> parameterNames, List<Object> arguments, Map<String, Object> hints, Statement.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 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 runtimehints- SeeQueryOptions.hints()options- All specified options
-
StaticStatementReference
public StaticStatementReference(String queryName, Class<?> annotatedClass, String annotatedMemberName, 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 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. -
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
-
getOptions
Description copied from interface:StatementReferenceAll options specified byQueryOptions,NamedQuery, orNamedNativeQuery, or an empty set if no options were specified.- Specified by:
getOptionsin interfaceStatementReference- See Also:
-
equals
-
hashCode
-
toString
-