Top Description Methods
org.hibernate.annotations

public @Interface NamedNativeQuery

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

Extends javax.persistence.NamedNativeQuery with Hibernate features.
Author
Emmanuel Bernard
See Also
org.hibernate.SQLQuery

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 boolean
callable()

Does the SQL (query()) represent a call to a procedure/function?

public String
comment()

A comment added to the SQL query.

public int
fetchSize()

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

public FlushModeType
flushMode()

The flush mode for the query.

public String
name()

The name.

public String
query()

The SQL query string.

public String[]
querySpaces()

The query spaces to apply for the query.

public boolean
readOnly()

Whether the results should be read-only.

public Class<T>
resultClass()

The result Class.

public String
resultSetMapping()

The name of a SQLResultSetMapping to use.

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.

callableback to summary
public boolean callable()

Does the SQL (query()) represent a call to a procedure/function?

commentback to summary
public String comment()

A comment added to the 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 the query.

nameback to summary
public String name()

The name. It is a named query after all :)

queryback to summary
public String query()

The SQL query string.

querySpacesback to summary
public String[] querySpaces()

The query spaces to apply for the query.

See Also
org.hibernate.SynchronizeableQuery
readOnlyback to summary
public boolean readOnly()

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

resultClassback to summary
public Class<T> resultClass()

The result Class. Should not be used in conjunction with resultSetMapping()

resultSetMappingback to summary
public String resultSetMapping()

The name of a SQLResultSetMapping to use. Should not be used in conjunction with resultClass().

timeoutback to summary
public int timeout()

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