Interface Reference

All Known Subinterfaces:
StatementReference, TypedQueryReference<R>
All Known Implementing Classes:
StaticStatementReference, StaticTypedQueryReference

public sealed interface Reference permits StatementReference, TypedQueryReference<R>
A reference to a named statement or query declared via the NamedQuery or NamedNativeQuery annotations, or using JakartaQuery or NativeQuery. An instance of Reference is usually obtained from the static metamodel. This interface declares operations common to StatementReference and TypedQueryReference.
Since:
4.0
  • Method Details

    • getName

      String getName()
      The name of the statement or query, as specified by NamedQuery.name() or NamedNativeQuery.name(), or as inferred from the name of the method annotated JakartaQuery or NativeQuery.
    • getParameterTypes

      List<Class<?>> getParameterTypes()
      The types of the supplied arguments to parameters of the statement or query, or null if 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.

      Since:
      4.0
    • getParameterNames

      List<String> getParameterNames()
      The names assigned to the supplied arguments to parameters of the statement or query, or null if 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.

      Since:
      4.0
    • getArguments

      List<Object> getArguments()
      The arguments supplied to the parameters of the statement or query, or null if 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.

      Since:
      4.0
      See Also:
    • getHints

      Map<String,Object> getHints()
      A map keyed by hint name of all hints specified via NamedQuery.hints(), NamedNativeQuery.hints(), or QueryOptions.hints().

      Any attempted mutation of the returned map results in an UnsupportedOperationException.