Annotation Interface NamedQuery


Declares a named query written in HQL or JPQL.

Whereas NamedQuery allows settings to be specified using stringly-typed QueryHints, this annotation is typesafe.

Note that the members of this annotation correspond to hints enumerated by AvailableHints.

See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The name of this query.
    The text of the HQL query.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the query results are cacheable.
    The cache interaction mode for this query.
    If the query results are cacheable, the name of the query cache region.
    The cache retrieval mode for objects returned by this query.
    The cache storage mode for objects returned by this query.
    A comment added to the generated SQL query.
    int
    The number of rows fetched by the JDBC driver per trip.
    Determines whether the session should be flushed before executing the query.
    Deprecated.
    boolean
    Whether the results should be loaded in read-only mode.
    Optional query result class that is used by default when creating the query.
    int
    The query timeout in seconds.