Package org.hibernate.annotations
Annotation Type NamedNativeQuery
-
@Target({TYPE,PACKAGE}) @Retention(RUNTIME) @Repeatable(NamedNativeQueries.class) public @interface NamedNativeQuery
ExtendsNamedNativeQuery
with Hibernate features.- See Also:
NativeQuery
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description boolean
cacheable
Whether the query (results) is cacheable or not.CacheModeType
cacheMode
The cache mode used for this query.String
cacheRegion
If the query results are cacheable, name the query cache region to use.boolean
callable
Deprecated.Calling database procedures and functions throughNativeQuery
is no longer supported; useNamedStoredProcedureQuery
insteadString
comment
A comment added to the SQL query.int
fetchSize
The number of rows fetched by the JDBC Driver per trip.FlushModeType
flushMode
The flush mode for the query.String[]
querySpaces
The query spaces to apply for the query.boolean
readOnly
Whether the results should be read-only.Class<?>
resultClass
The result Class.String
resultSetMapping
The name of a SQLResultSetMapping to use.int
timeout
The query timeout (in seconds).
-
-
-
Element Detail
-
name
String name
The registration name.- See Also:
EntityManagerFactory.addNamedQuery(java.lang.String, jakarta.persistence.Query)
,Session.createNamedQuery(java.lang.String, java.lang.Class<R>)
-
-
-
query
String query
The SQL query string.
-
-
-
resultClass
Class<?> resultClass
The result Class. Should not be used in conjunction withresultSetMapping()
- Default:
- void.class
-
-
-
resultSetMapping
String resultSetMapping
The name of a SQLResultSetMapping to use. Should not be used in conjunction withresultClass()
.- Default:
- ""
-
-
-
flushMode
FlushModeType flushMode
The flush mode for the query.- Default:
- org.hibernate.annotations.FlushModeType.PERSISTENCE_CONTEXT
-
-
-
cacheRegion
String cacheRegion
If the query results are cacheable, name the query cache region to use.- Default:
- ""
-
-
-
comment
String comment
A comment added to the SQL query. Useful when engaging with DBA.- Default:
- ""
-
-
-
cacheMode
CacheModeType cacheMode
The cache mode used for this query. This refers to entities/collections returned from the query.- Default:
- org.hibernate.annotations.CacheModeType.NORMAL
-
-
-
querySpaces
String[] querySpaces
The query spaces to apply for the query.- See Also:
SynchronizeableQuery
- Default:
- {}
-
-
-
callable
@Deprecated(since="6.0") boolean callable
Deprecated.Calling database procedures and functions throughNativeQuery
is no longer supported; useNamedStoredProcedureQuery
insteadDoes the SQL (query()
) represent a call to a procedure/function?- Default:
- false
-
-