Package org.hibernate.annotations
Annotation Type NamedQuery
-
@Target({TYPE,PACKAGE}) @Retention(RUNTIME) @Repeatable(NamedQueries.class) public @interface NamedQuery
ExtendsNamedQuery
with Hibernate features.- See Also:
Query
-
-
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.String
comment
A comment added to the generated SQL query.int
fetchSize
The number of rows fetched by the JDBC Driver per trip.FlushModeType
flushMode
The flush mode for this query.boolean
readOnly
Whether the results should be read-only.int
timeout
The query timeout (in seconds).
-
-
-
Element Detail
-
name
String name
The name of thisNamedQuery
.
-
-
-
query
String query
The query string for thisNamedQuery
.
-
-
-
flushMode
FlushModeType flushMode
The flush mode for this 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 generated 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
-
-