Annotation Type NamedQuery


@Target({TYPE,PACKAGE}) @Retention(RUNTIME) public @interface NamedQuery
Extends NamedQuery with Hibernate features
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    the name of the NamedQuery
    the Query String for the NamedQuery
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    mark the query as cacheable or not
    the cache mode used for this query
    the cache region to use
    comment added to the SQL query, useful for the DBA
    int
    the number of rows fetched by the JDBC Driver per roundtrip
    the flush mode for the query
    boolean
    marks whether the results are fetched in read-only mode or not
    int
    the query timeout in seconds
  • Element Details

    • name

      String name
      the name of the NamedQuery
    • query

      String query
      the Query String for the NamedQuery
    • flushMode

      FlushModeType flushMode
      the flush mode for the query
      Default:
      PERSISTENCE_CONTEXT
    • cacheable

      boolean cacheable
      mark the query as cacheable or not
      Default:
      false
    • cacheRegion

      String cacheRegion
      the cache region to use
      Default:
      ""
    • fetchSize

      int fetchSize
      the number of rows fetched by the JDBC Driver per roundtrip
      Default:
      -1
    • timeout

      int timeout
      the query timeout in seconds
      Default:
      -1
    • comment

      String comment
      comment added to the SQL query, useful for the DBA
      Default:
      ""
    • cacheMode

      CacheModeType cacheMode
      the cache mode used for this query
      Default:
      NORMAL
    • readOnly

      boolean readOnly
      marks whether the results are fetched in read-only mode or not
      Default:
      false