Top Description Fields Constructors Methods
org.hibernate.engine

public Class NamedSQLQueryDefinition

extends NamedQueryDefinition
Class Inheritance
Imports
java.util.List, .Map, org.hibernate.FlushMode, .CacheMode, org.hibernate.engine.query.sql.NativeSQLQueryReturn

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

Field Summary

Modifier and TypeField and Description
private final boolean
private NativeSQLQueryReturn[]
private final List<String>
private String

Constructor Summary

AccessConstructor and Description
public
NamedSQLQueryDefinition(String
The sql query string
query
,
NativeSQLQueryReturn[]
The in-lined query return definitions
queryReturns
,
List<String>
Any specified query spaces (used for auto-flushing)
querySpaces
,
boolean
Whether the query results are cacheable
cacheable
,
String
If cacheable, the region into which to store the results
cacheRegion
,
Integer
A JDBC-level timeout to be applied
timeout
,
Integer
A JDBC-level fetch-size to be applied
fetchSize
,
FlushMode
The flush mode to use for this query
flushMode
,
CacheMode
The cache mode to use during execution and subsequent result loading
cacheMode
,
boolean
Whether returned entities should be marked as read-only in the session
readOnly
,
String
Any sql comment to be applied to the query
comment
,
Map<K, V>
parameter type map
parameterTypes
,
boolean
Does the query string represent a callable object (i.e., proc)
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)

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

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

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

Deprecated
This form used from annotations (?).

Method Summary

Modifier and TypeMethod and Description
public NativeSQLQueryReturn[]
public List<String>
public String
public boolean
Inherited from org.hibernate.engine.NamedQueryDefinition:
getCacheModegetCacheRegiongetCommentgetFetchSizegetFlushModegetParameterTypesgetQuerygetQueryStringgetTimeoutisCacheableisReadOnlytoString

Field Detail

callableback to summary
private final boolean callable
queryReturnsback to summary
private NativeSQLQueryReturn[] queryReturns
querySpacesback to summary
private final List<String> querySpaces
resultSetRefback to summary
private String resultSetRef

Constructor Detail

NamedSQLQueryDefinitionback to summary
public NamedSQLQueryDefinition(String query, NativeSQLQueryReturn[] queryReturns, List<String> querySpaces, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, CacheMode cacheMode, boolean readOnly, String comment, Map<K, V> 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
query:String

The sql query string

queryReturns:NativeSQLQueryReturn[]

The in-lined query return definitions

querySpaces:List<String>

Any specified query spaces (used for auto-flushing)

cacheable:boolean

Whether the query results are cacheable

cacheRegion:String

If cacheable, the region into which to store the results

timeout:Integer

A JDBC-level timeout to be applied

fetchSize:Integer

A JDBC-level fetch-size to be applied

flushMode:FlushMode

The flush mode to use for this query

cacheMode:CacheMode

The cache mode to use during execution and subsequent result loading

readOnly:boolean

Whether returned entities should be marked as read-only in the session

comment:String

Any sql comment to be applied to the query

parameterTypes:Map<K, V>

parameter type map

callable:boolean

Does the query string represent a callable object (i.e., proc)

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

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

Parameters
query:String

The sql query string

resultSetRef:String

The resultset-mapping name

querySpaces:List<String>

Any specified query spaces (used for auto-flushing)

cacheable:boolean

Whether the query results are cacheable

cacheRegion:String

If cacheable, the region into which to store the results

timeout:Integer

A JDBC-level timeout to be applied

fetchSize:Integer

A JDBC-level fetch-size to be applied

flushMode:FlushMode

The flush mode to use for this query

cacheMode:CacheMode

The cache mode to use during execution and subsequent result loading

readOnly:boolean

Whether returned entities should be marked as read-only in the session

comment:String

Any sql comment to be applied to the query

parameterTypes:Map<K, V>

parameter type map

callable:boolean

Does the query string represent a callable object (i.e., proc)

NamedSQLQueryDefinitionback to summary
public NamedSQLQueryDefinition(String query, String resultSetRef, List<String> querySpaces, boolean cacheable, String cacheRegion, Integer timeout, Integer fetchSize, FlushMode flushMode, Map<K, V> 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:String

The sql query string

resultSetRef:String

The result-set-mapping name

querySpaces:List<String>

Any specified query spaces (used for auto-flushing)

cacheable:boolean

Whether the query results are cacheable

cacheRegion:String

If cacheable, the region into which to store the results

timeout:Integer

A JDBC-level timeout to be applied

fetchSize:Integer

A JDBC-level fetch-size to be applied

flushMode:FlushMode

The flush mode to use for this query

parameterTypes:Map<K, V>

parameter type map

callable:boolean

Does the query string represent a callable object (i.e., proc)

Method Detail

getQueryReturnsback to summary
public NativeSQLQueryReturn[] getQueryReturns()
getQuerySpacesback to summary
public List<String> getQuerySpaces()
getResultSetRefback to summary
public String getResultSetRef()
isCallableback to summary
public boolean isCallable()