Annotation Type NamedNativeQuery


  • @Repeatable(NamedNativeQueries.class)
    @Target(TYPE)
    @Retention(RUNTIME)
    public @interface NamedNativeQuery
    Specifies a named native SQL query. Query names are scoped to the persistence unit. The NamedNativeQuery annotation can be applied to an entity or mapped superclass.
    Since:
    1.0
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String name
      The name used to refer to the query with the EntityManager methods that create query objects.
      java.lang.String query
      The SQL query string.
    • Element Detail

      • name

        java.lang.String name
        The name used to refer to the query with the EntityManager methods that create query objects.
      • query

        java.lang.String query
        The SQL query string.
      • hints

        QueryHint[] hints
        Query properties and hints. (May include vendor-specific query hints.)
        Default:
        {}
      • resultClass

        java.lang.Class resultClass
        The class of the result.
        Default:
        void.class
      • resultSetMapping

        java.lang.String resultSetMapping
        The name of a SqlResultSetMapping, as defined in metadata.
        Default:
        ""