Annotation Type NamedNativeQuery

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String name
      The name.
      java.lang.String query
      The SQL query string.
    • 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.
      java.lang.String cacheRegion
      If the query results are cacheable, name the query cache region to use.
      boolean callable
      Does the SQL (query()) represent a call to a procedure/function?
      java.lang.String comment
      A comment added to the SQL query.
      int fetchSize
      The number of rows fetched by the JDBC Driver per trip.
      FlushModeType flushMode
      The flush mode for the query.
      java.lang.String[] querySpaces
      The query spaces to apply for the query.
      boolean readOnly
      Whether the results should be read-only.
      java.lang.Class resultClass
      The result Class.
      java.lang.String resultSetMapping
      The name of a SQLResultSetMapping to use.
      int timeout
      The query timeout (in seconds).
    • Element Detail

      • name

        java.lang.String name
        The name. It is a named query after all :)
      • query

        java.lang.String query
        The SQL query string.
      • resultClass

        java.lang.Class resultClass
        The result Class. Should not be used in conjunction with resultSetMapping()
        Default:
        void.class
      • resultSetMapping

        java.lang.String resultSetMapping
        The name of a SQLResultSetMapping to use. Should not be used in conjunction with resultClass().
        Default:
        ""
      • flushMode

        FlushModeType flushMode
        The flush mode for the query.
        Default:
        org.hibernate.annotations.FlushModeType.PERSISTENCE_CONTEXT
      • cacheable

        boolean cacheable
        Whether the query (results) is cacheable or not. Default is false, that is not cacheable.
        Default:
        false
      • cacheRegion

        java.lang.String cacheRegion
        If the query results are cacheable, name the query cache region to use.
        Default:
        ""
      • fetchSize

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

        int timeout
        The query timeout (in seconds). Default is no timeout.
        Default:
        -1
      • callable

        boolean callable
        Does the SQL (query()) represent a call to a procedure/function?
        Default:
        false
      • comment

        java.lang.String comment
        A comment added to the 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
      • readOnly

        boolean readOnly
        Whether the results should be read-only. Default is false.
        Default:
        false
      • querySpaces

        java.lang.String[] querySpaces
        The query spaces to apply for the query.
        See Also:
        SynchronizeableQuery
        Default:
        {}