javax.persistence

## Annotation Type NamedNativeQuery

-     @Target(value=TYPE)
      @Retention(value=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:
    Java Persistence 1.0

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `name` The name used to refer to the query with the `EntityManager` methods that create query objects.
    `String` | `query` The SQL query string.

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `QueryHint[]` | `hints` Query properties and hints.
    `Class` | `resultClass` The class of the result.
    `String` | `resultSetMapping` The name of a `SqlResultSetMapping`, as defined in metadata.

- - ### Element Detail

    - #### name

          public abstract String name

      The name used to refer to the query with the `EntityManager` methods that create query objects.

    - #### query

          public abstract String query

      The SQL query string.

    - #### hints

          public abstract QueryHint[] hints

      Query properties and hints. (May include vendor-specific query hints.)
      Default:
        {}

    - #### resultClass

          public abstract Class resultClass

      The class of the result.
      Default:
        void.class

    - #### resultSetMapping

          public abstract String resultSetMapping

      The name of a `SqlResultSetMapping`, as defined in metadata.
      Default:
        ""

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.