Top Description Methods
org.hibernate.annotations

public @Interface NamedQuery

extends Annotation
Annotations
@Target:TYPE, PACKAGE
@Retention:RUNTIME
@Repeatable:NamedQueries
Imports
java.lang.annotation.Repeatable, .Retention, .Target

Extends javax.persistence.NamedQuery with Hibernate features.
Author
Carlos Gonzalez-Cadenas
See Also
org.hibernate.Query

Method Summary

Modifier and TypeMethod and Description
public boolean
cacheable()

Whether the query (results) is cacheable or not.

public CacheModeType
cacheMode()

The cache mode used for this query.

public String
cacheRegion()

If the query results are cacheable, name the query cache region to use.

public String
comment()

A comment added to the generated SQL query.

public int
fetchSize()

The number of rows fetched by the JDBC Driver per trip.

public FlushModeType
flushMode()

The flush mode for this query.

public String
name()

The name of this NamedQuery.

public String
query()

The query string for this NamedQuery.

public boolean
readOnly()

Whether the results should be read-only.

public int
timeout()

The query timeout (in seconds).

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

cacheableback to summary
public boolean cacheable()

Whether the query (results) is cacheable or not. Default is false, that is not cacheable.

cacheModeback to summary
public CacheModeType cacheMode()

The cache mode used for this query. This refers to entities/collections returned from the query.

cacheRegionback to summary
public String cacheRegion()

If the query results are cacheable, name the query cache region to use.

commentback to summary
public String comment()

A comment added to the generated SQL query. Useful when engaging with DBA.

fetchSizeback to summary
public int fetchSize()

The number of rows fetched by the JDBC Driver per trip.

flushModeback to summary
public FlushModeType flushMode()

The flush mode for this query.

nameback to summary
public String name()

The name of this NamedQuery.

queryback to summary
public String query()

The query string for this NamedQuery.

readOnlyback to summary
public boolean readOnly()

Whether the results should be read-only. Default is false.

timeoutback to summary
public int timeout()

The query timeout (in seconds). Default is no timeout.