@Target(TYPE)
@Retention(RUNTIME)
@Repeatable(NamedNativeQueries.class)
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 -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionQuery properties and hints.The class of the result.The name of a, as defined in metadata.invalid reference
SqlResultSetMapping
-
Element Details
-
name
String nameThe name used to refer to the query with themethods that create query objects.invalid reference
EntityManager- Returns:
- The name
-
query
String queryThe SQL query string.- Returns:
- The SQL string
-
hints
QueryHint[] hintsQuery properties and hints. (May include vendor-specific query hints.)- Returns:
- any hints
- Default:
{}
-
resultClass
Class resultClassThe class of the result.- Returns:
- The result class
- Default:
void.class
-
resultSetMapping
String resultSetMappingThe name of a, as defined in metadata.invalid reference
SqlResultSetMapping- Returns:
- ResultSet mapping
- Default:
""
-