NamedSQLQueryDefinition (Hibernate JavaDocs)
Date: 2012-04-05

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.engine.spi
Class NamedSQLQueryDefinition

    java.lang.Object
      org.hibernate.engine.spi.NamedQueryDefinition
          org.hibernate.engine.spi.NamedSQLQueryDefinition

All Implemented Interfaces:
  Serializable

    public class NamedSQLQueryDefinition

extends NamedQueryDefinition

Definition of a named native SQL query, defined in the mapping metadata.

See Also:
  Serialized Form

Constructor Summary
`NamedSQLQueryDefinition(String query, String resultSetRef, List<String> querySpaces, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, Map parameterTypes, boolean callable)` Deprecated.
`NamedSQLQueryDefinition(String name, String query, NativeSQLQueryReturn[] queryReturns, List<String> querySpaces, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map parameterTypes, boolean callable)` This form used to construct a NamedSQLQueryDefinition from the binder code when a the result-set mapping information is explicitly provided in the query definition (i.e., no resultset-mapping used)
`NamedSQLQueryDefinition(String name, String query, String resultSetRef, List<String> querySpaces, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map parameterTypes, boolean callable)` This form used to construct a NamedSQLQueryDefinition from the binder code when a resultset-mapping reference is used.

Method Summary
`NativeSQLQueryReturn[]` | `getQueryReturns()`
`List<String>` | `getQuerySpaces()`
`String` | `getResultSetRef()`
`boolean` | `isCallable()`

Methods inherited from class org.hibernate.engine.spi.NamedQueryDefinition
`getCacheMode, getCacheRegion, getComment, getFetchSize, getFlushMode, getName, getParameterTypes, getQuery, getQueryString, getTimeout, isCacheable, isReadOnly, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### NamedSQLQueryDefinition

    public NamedSQLQueryDefinition(String name,
                                   String query,
                                   NativeSQLQueryReturn[] queryReturns,
                                   List<String> querySpaces,
                                   boolean cacheable,
                                   String cacheRegion,
                                   Integer timeout,
                                   Integer fetchSize,
                                   FlushMode flushMode,
                                   CacheMode cacheMode,
                                   boolean readOnly,
                                   String comment,
                                   Map parameterTypes,
                                   boolean callable)

  This form used to construct a NamedSQLQueryDefinition from the binder code when a the result-set mapping information is explicitly provided in the query definition (i.e., no resultset-mapping used)

  Parameters:
    `name` - The name of named query
    `query` - The sql query string
    `queryReturns` - The in-lined query return definitions
    `querySpaces` - Any specified query spaces (used for auto-flushing)
    `cacheable` - Whether the query results are cacheable
    `cacheRegion` - If cacheable, the region into which to store the results
    `timeout` - A JDBC-level timeout to be applied
    `fetchSize` - A JDBC-level fetch-size to be applied
    `flushMode` - The flush mode to use for this query
    `cacheMode` - The cache mode to use during execution and subsequent result loading
    `readOnly` - Whether returned entities should be marked as read-only in the session
    `comment` - Any sql comment to be applied to the query
    `parameterTypes` - parameter type map
    `callable` - Does the query string represent a callable object (i.e., proc)

### NamedSQLQueryDefinition

    public NamedSQLQueryDefinition(String name,
                                   String query,
                                   String resultSetRef,
                                   List<String> querySpaces,
                                   boolean cacheable,
                                   String cacheRegion,
                                   Integer timeout,
                                   Integer fetchSize,
                                   FlushMode flushMode,
                                   CacheMode cacheMode,
                                   boolean readOnly,
                                   String comment,
                                   Map parameterTypes,
                                   boolean callable)

  This form used to construct a NamedSQLQueryDefinition from the binder code when a resultset-mapping reference is used.

  Parameters:
    `name` - The name of named query
    `query` - The sql query string
    `resultSetRef` - The resultset-mapping name
    `querySpaces` - Any specified query spaces (used for auto-flushing)
    `cacheable` - Whether the query results are cacheable
    `cacheRegion` - If cacheable, the region into which to store the results
    `timeout` - A JDBC-level timeout to be applied
    `fetchSize` - A JDBC-level fetch-size to be applied
    `flushMode` - The flush mode to use for this query
    `cacheMode` - The cache mode to use during execution and subsequent result loading
    `readOnly` - Whether returned entities should be marked as read-only in the session
    `comment` - Any sql comment to be applied to the query
    `parameterTypes` - parameter type map
    `callable` - Does the query string represent a callable object (i.e., proc)

### NamedSQLQueryDefinition

    public NamedSQLQueryDefinition(String query,
                                   String resultSetRef,
                                   List<String> querySpaces,
                                   boolean cacheable,
                                   String cacheRegion,
                                   Integer timeout,
                                   Integer fetchSize,
                                   FlushMode flushMode,
                                   Map parameterTypes,
                                   boolean callable)

  Deprecated.

  This form used from annotations (?). Essentially the same as the above using a resultset-mapping reference, but without cacheMode, readOnly, and comment. FIXME: annotations do not use it, so it can be remove from my POV

  Parameters:
    `query` - The sql query string
    `resultSetRef` - The result-set-mapping name
    `querySpaces` - Any specified query spaces (used for auto-flushing)
    `cacheable` - Whether the query results are cacheable
    `cacheRegion` - If cacheable, the region into which to store the results
    `timeout` - A JDBC-level timeout to be applied
    `fetchSize` - A JDBC-level fetch-size to be applied
    `flushMode` - The flush mode to use for this query
    `parameterTypes` - parameter type map
    `callable` - Does the query string represent a callable object (i.e., proc)

Method Detail

### getQueryReturns

    public NativeSQLQueryReturn[] getQueryReturns()

### getQuerySpaces

    public List<String> getQuerySpaces()

### isCallable

    public boolean isCallable()

### getResultSetRef

    public String getResultSetRef()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.