NativeQuery
instead.@Deprecated public interface SQLQuery<T> extends Query<T>, SynchronizeableQuery<T>
Represents a "native sql" query.
Allows the user to define certain aspects about its execution, such as:<ul>
<li>
result-set value mapping (see below)
</li>
<li>
Tables used via addSynchronizedQuerySpace(java.lang.String)
, addSynchronizedEntityName(java.lang.String)
and
addSynchronizedEntityClass(java.lang.Class)
. This allows Hibernate to know how to properly deal with
auto-flush checking as well as cached query results if the results of the query are being
cached.
</li>
</ul>
In terms of result-set mapping, there are 3 approaches to defining:<ul>
<li>
If this represents a named sql query, the mapping could be associated with the query as part
of its metadata
</li>
<li>
A pre-defined (defined in metadata and named) mapping can be associated with
setResultSetMapping(java.lang.String)
</li>
<li>
Defined locally per the various addEntity(java.lang.String)
, addRoot(java.lang.String, java.lang.String)
, addJoin(java.lang.String, java.lang.String)
,
addFetch(java.lang.String, java.lang.String, java.lang.String)
and addScalar(java.lang.String)
methods
</li>
</ul>
Modifier and Type | Interface and Description |
---|---|
static interface |
SQLQuery.FetchReturn
Deprecated.
Allows access to further control how join fetch returns are mapped back from result sets.
|
static interface |
SQLQuery.ReturnProperty
Deprecated.
Allows access to further control how properties within a root or join fetch are mapped back from the result set.
|
static interface |
SQLQuery.RootReturn
Deprecated.
Allows access to further control how root returns are mapped back from result sets.
|
Modifier and Type | Method and Description |
---|---|
SQLQuery<T> |
addEntity(Class entityType)
Deprecated.
Declare a "root" entity, without specifying an alias.
|
SQLQuery<T> |
addEntity(String entityName)
Deprecated.
Declare a "root" entity, without specifying an alias.
|
SQLQuery<T> |
addEntity(String tableAlias,
Class entityType)
Deprecated.
Declare a "root" entity.
|
SQLQuery<T> |
addEntity(String tableAlias,
Class entityClass,
LockMode lockMode)
Deprecated.
Declare a "root" entity, specifying a lock mode.
|
SQLQuery<T> |
addEntity(String tableAlias,
String entityName)
Deprecated.
Declare a "root" entity.
|
SQLQuery<T> |
addEntity(String tableAlias,
String entityName,
LockMode lockMode)
Deprecated.
Declare a "root" entity, specifying a lock mode.
|
SQLQuery.FetchReturn |
addFetch(String tableAlias,
String ownerTableAlias,
String joinPropertyName)
Deprecated.
Declare a join fetch result.
|
SQLQuery<T> |
addJoin(String tableAlias,
String path)
Deprecated.
Declare a join fetch result.
|
SQLQuery<T> |
addJoin(String tableAlias,
String path,
LockMode lockMode)
Deprecated.
Declare a join fetch result, specifying a lock mode.
|
SQLQuery<T> |
addJoin(String tableAlias,
String ownerTableAlias,
String joinPropertyName)
Deprecated.
Declare a join fetch result.
|
NativeQuery<T> |
addQueryHint(String hint)
Deprecated.
Add a DB query hint to the SQL.
|
SQLQuery.RootReturn |
addRoot(String tableAlias,
Class entityType)
Deprecated.
Add a new root return mapping, returning a
NativeQuery.RootReturn to allow further definition. |
SQLQuery.RootReturn |
addRoot(String tableAlias,
String entityName)
Deprecated.
Add a new root return mapping, returning a
NativeQuery.RootReturn to allow further definition. |
SQLQuery<T> |
addScalar(String columnAlias)
Deprecated.
Declare a scalar query result.
|
SQLQuery<T> |
addScalar(String columnAlias,
Type type)
Deprecated.
Declare a scalar query result.
|
SQLQuery<T> |
addSynchronizedEntityClass(Class entityClass)
Deprecated.
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.
|
SQLQuery<T> |
addSynchronizedEntityName(String entityName)
Deprecated.
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.
|
SQLQuery<T> |
addSynchronizedQuerySpace(String querySpace)
Deprecated.
Adds a query space.
|
List<NativeSQLQueryReturn> |
getQueryReturns()
Deprecated.
Retrieve the returns associated with this query.
|
boolean |
isCallable()
Deprecated.
Is this native-SQL query known to be callable?
|
NativeQuery<T> |
setCacheable(boolean cacheable)
Deprecated.
Enable/disable second level query (result) caching for this query.
|
NativeQuery<T> |
setCacheMode(CacheMode cacheMode)
Deprecated.
(Re)set the current CacheMode in effect for this query.
|
NativeQuery<T> |
setCacheRegion(String cacheRegion)
Deprecated.
Set the name of the cache region where query results should be cached (if cached at all).
|
NativeQuery<T> |
setComment(String comment)
Deprecated.
Set the comment for this query.
|
NativeQuery<T> |
setFetchSize(int fetchSize)
Deprecated.
Sets a JDBC fetch size hint for the query.
|
NativeQuery<T> |
setFlushMode(FlushMode flushMode)
Deprecated.
(Re)set the current FlushMode in effect for this query.
|
NativeQuery<T> |
setFlushMode(FlushModeType flushMode)
Deprecated.
|
NativeQuery<T> |
setHibernateFlushMode(FlushMode flushMode)
Deprecated.
(Re)set the current FlushMode in effect for this query.
|
NativeQuery<T> |
setLockMode(String alias,
LockMode lockMode)
Deprecated.
Set the LockMode to use for specific alias (as defined in the query’s <tt>FROM</tt> clause).
|
NativeQuery<T> |
setLockOptions(LockOptions lockOptions)
Deprecated.
Set the lock options for the query.
|
NativeQuery<T> |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Deprecated.
|
NativeQuery<T> |
setParameter(int position,
Date value,
TemporalType temporalType)
Deprecated.
|
NativeQuery<T> |
setParameter(int position,
Object val)
Deprecated.
Bind a positional query parameter using its inferred Type.
|
NativeQuery<T> |
setParameter(int position,
Object val,
Type type)
Deprecated.
Bind a value to a JDBC-style query parameter.
|
<P> NativeQuery<T> |
setParameter(int position,
P val,
TemporalType temporalType)
Deprecated.
Bind a positional query parameter as some form of date/time using
the indicated temporal-type.
|
NativeQuery<T> |
setParameter(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Deprecated.
|
NativeQuery<T> |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Deprecated.
|
<P> NativeQuery<T> |
setParameter(Parameter<P> param,
P value)
Deprecated.
|
<P> NativeQuery<T> |
setParameter(QueryParameter<P> parameter,
P val)
Deprecated.
Bind a query parameter using its inferred Type.
|
<P> NativeQuery<T> |
setParameter(QueryParameter<P> parameter,
P val,
TemporalType temporalType)
Deprecated.
Bind a query parameter as some form of date/time using the indicated
temporal-type.
|
<P> NativeQuery<T> |
setParameter(QueryParameter<P> parameter,
P val,
Type type)
Deprecated.
Bind a query parameter using the supplied Type
|
NativeQuery<T> |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Deprecated.
|
NativeQuery<T> |
setParameter(String name,
Date value,
TemporalType temporalType)
Deprecated.
|
NativeQuery<T> |
setParameter(String name,
Object val)
Deprecated.
Bind a named query parameter using its inferred Type.
|
NativeQuery<T> |
setParameter(String name,
Object val,
Type type)
Deprecated.
Bind a named query parameter using the supplied Type
|
<P> NativeQuery<T> |
setParameter(String name,
P val,
TemporalType temporalType)
Deprecated.
Bind a named query parameter as some form of date/time using
the indicated temporal-type.
|
<P> NativeQuery<T> |
setParameterList(QueryParameter<P> parameter,
Collection<P> values)
Deprecated.
Bind multiple values to a query parameter using its inferred Type.
|
NativeQuery<T> |
setParameterList(String name,
Collection values)
Deprecated.
Bind multiple values to a named query parameter.
|
NativeQuery<T> |
setParameterList(String name,
Collection values,
Type type)
Deprecated.
Bind multiple values to a named query parameter.
|
NativeQuery<T> |
setParameterList(String name,
Object[] values)
Deprecated.
Bind multiple values to a named query parameter.
|
NativeQuery<T> |
setParameterList(String name,
Object[] values,
Type type)
Deprecated.
Bind multiple values to a named query parameter.
|
NativeQuery<T> |
setProperties(Map bean)
Deprecated.
Bind the values of the given Map for each named parameters of the query,
matching key names with parameter names and mapping value types to
Hibernate types using heuristics.
|
NativeQuery<T> |
setProperties(Object bean)
Deprecated.
Bind the property values of the given bean to named parameters of the query,
matching property names with parameter names and mapping property types to
Hibernate types using heuristics.
|
NativeQuery<T> |
setReadOnly(boolean readOnly)
Deprecated.
Set the read-only/modifiable mode for entities and proxies
loaded by this Query.
|
SQLQuery<T> |
setResultSetMapping(String name)
Deprecated.
Use a predefined named result-set mapping.
|
NativeQuery<T> |
setTimeout(int timeout)
Deprecated.
Set the query timeout <b>in seconds</b>.
|
determineProperBooleanType, determineProperBooleanType, getCacheMode, getCacheRegion, getComment, getFetchSize, getFlushMode, getHibernateFlushMode, getLockOptions, getNamedParameters, getParameterMetadata, getQueryString, getReturnAliases, getReturnTypes, getTimeout, isCacheable, isReadOnly, iterate, list, scroll, scroll, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFirstResult, setFloat, setFloat, setHint, setInteger, setInteger, setLocale, setLocale, setLockMode, setLong, setLong, setMaxResults, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp, uniqueResult
getResultList, getResultStream, getSingleResult
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
getSynchronizedQuerySpaces
SQLQuery<T> setResultSetMapping(String name)
Use a predefined named result-set mapping. This might be defined by a <result-set/>
element in a
Hibernate <tt>hbm.xml</tt> file or through a SqlResultSetMapping
annotation.
name
- The name of the mapping to use.boolean isCallable()
Is this native-SQL query known to be callable?
true
if the query is known to be callable; false
otherwise.List<NativeSQLQueryReturn> getQueryReturns()
Retrieve the returns associated with this query.
SQLQuery<T> addScalar(String columnAlias)
Declare a scalar query result. Hibernate will attempt to automatically detect the underlying type.
<p/>
Functions like <return-scalar/>
in hbm.xml
or ColumnResult
columnAlias
- The column alias in the result-set to be processed as a scalar resultthis
, for method chainingSQLQuery<T> addScalar(String columnAlias, Type type)
Declare a scalar query result.
<p/>
Functions like <return-scalar/>
in hbm.xml
or ColumnResult
columnAlias
- The column alias in the result-set to be processed as a scalar resulttype
- The Hibernate type as which to treat the value.this
, for method chainingSQLQuery.RootReturn addRoot(String tableAlias, String entityName)
Add a new root return mapping, returning a NativeQuery.RootReturn
to allow further definition.
tableAlias
- The SQL table alias to map to this entityentityName
- The name of the entity.SQLQuery.RootReturn addRoot(String tableAlias, Class entityType)
Add a new root return mapping, returning a NativeQuery.RootReturn
to allow further definition.
tableAlias
- The SQL table alias to map to this entityentityType
- The java type of the entity.SQLQuery<T> addEntity(String entityName)
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the
same as the unqualified entity name
<p/>
Use addRoot(java.lang.String, java.lang.String)
if you need further control of the mapping
entityName
- The entity name that is the root return of the query.this
, for method chainingSQLQuery<T> addEntity(String tableAlias, String entityName)
Declare a "root" entity.
tableAlias
- The SQL table aliasentityName
- The entity namethis
, for method chainingSQLQuery<T> addEntity(String tableAlias, String entityName, LockMode lockMode)
Declare a "root" entity, specifying a lock mode.
tableAlias
- The SQL table aliasentityName
- The entity namelockMode
- The lock mode for this return.this
, for method chainingSQLQuery<T> addEntity(Class entityType)
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name
entityType
- The java type of the entity to add as a rootthis
, for method chainingSQLQuery<T> addEntity(String tableAlias, Class entityType)
Declare a "root" entity.
tableAlias
- The SQL table aliasentityType
- The java type of the entity to add as a rootthis
, for method chainingSQLQuery<T> addEntity(String tableAlias, Class entityClass, LockMode lockMode)
Declare a "root" entity, specifying a lock mode.
tableAlias
- The SQL table aliasentityClass
- The entity ClasslockMode
- The lock mode for this return.this
, for method chainingSQLQuery.FetchReturn addFetch(String tableAlias, String ownerTableAlias, String joinPropertyName)
Declare a join fetch result.
tableAlias
- The SQL table alias for the data to be mapped to this fetchownerTableAlias
- Identify the table alias of the owner of this association. Should match the alias of a
previously added root or fetchjoinPropertyName
- The name of the property being join fetched.SQLQuery<T> addJoin(String tableAlias, String path)
Declare a join fetch result.
tableAlias
- The SQL table alias for the data to be mapped to this fetchpath
- The association path ([owner-alias].[property-name]).this
, for method chainingSQLQuery<T> addJoin(String tableAlias, String ownerTableAlias, String joinPropertyName)
Declare a join fetch result.
tableAlias
- The SQL table alias for the data to be mapped to this fetchownerTableAlias
- Identify the table alias of the owner of this association. Should match the alias of a
previously added root or fetchjoinPropertyName
- The name of the property being join fetched.this
, for method chainingSQLQuery<T> addJoin(String tableAlias, String path, LockMode lockMode)
Declare a join fetch result, specifying a lock mode.
tableAlias
- The SQL table alias for the data to be mapped to this fetchpath
- The association path ([owner-alias].[property-name]).lockMode
- The lock mode for this return.this
, for method chainingSQLQuery<T> addSynchronizedQuerySpace(String querySpace)
SynchronizeableQuery
Adds a query space.
addSynchronizedQuerySpace
in interface SynchronizeableQuery<T>
querySpace
- The query space to be auto-flushed for this query.this
, for method chainingSQLQuery<T> addSynchronizedEntityName(String entityName) throws MappingException
SynchronizeableQuery
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
SynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.
addSynchronizedEntityName
in interface SynchronizeableQuery<T>
entityName
- The name of the entity upon whose defined query spaces we should additionally synchronize.this
, for method chainingMappingException
- Indicates the given name could not be resolved as an entitySQLQuery<T> addSynchronizedEntityClass(Class entityClass) throws MappingException
SynchronizeableQuery
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same as
SynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.
addSynchronizedEntityClass
in interface SynchronizeableQuery<T>
entityClass
- The class of the entity upon whose defined query spaces we should additionally synchronize.this
, for method chainingMappingException
- Indicates the given class could not be resolved as an entityNativeQuery<T> setHibernateFlushMode(FlushMode flushMode)
Query
(Re)set the current FlushMode in effect for this query.
setHibernateFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chainingQuery.getHibernateFlushMode()
NativeQuery<T> setFlushMode(FlushModeType flushMode)
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<T>
NativeQuery<T> setCacheMode(CacheMode cacheMode)
Query
(Re)set the current CacheMode in effect for this query.
setCacheMode
in interface BasicQueryContract<CommonQueryContract>
cacheMode
- The new CacheMode to use.this
, for method chainingQuery.getCacheMode()
NativeQuery<T> setCacheable(boolean cacheable)
Query
Enable/disable second level query (result) caching for this query.
setCacheable
in interface BasicQueryContract<CommonQueryContract>
cacheable
- Should the query results be cacheable?this
, for method chainingQuery.isCacheable()
NativeQuery<T> setCacheRegion(String cacheRegion)
Query
Set the name of the cache region where query results should be cached (if cached at all).
setCacheRegion
in interface BasicQueryContract<CommonQueryContract>
cacheRegion
- the name of a query cache region, or null
to indicate that the default region
should be used.this
, for method chainingQuery.getCacheRegion()
NativeQuery<T> setTimeout(int timeout)
Query
Set the query timeout <b>in seconds</b>.
NOTE it is important to understand that any value set here is eventually passed directly through to the JDBC Statement which expressly disallows negative values. So negative values should be avoided as a general rule.
setTimeout
in interface BasicQueryContract<CommonQueryContract>
timeout
- the timeout <b>in seconds</b>this
, for method chainingQuery.getTimeout()
NativeQuery<T> setFetchSize(int fetchSize)
Query
Sets a JDBC fetch size hint for the query.
setFetchSize
in interface BasicQueryContract<CommonQueryContract>
fetchSize
- the fetch size hintthis
, for method chainingQuery.getFetchSize()
NativeQuery<T> setReadOnly(boolean readOnly)
Query
Set the read-only/modifiable mode for entities and proxies loaded by this Query. This setting overrides the default setting for the persistence context.
setReadOnly
in interface BasicQueryContract<CommonQueryContract>
readOnly
- true
indicates that entities and proxies loaded by the query
are to be put in read-only mode; false
indicates that entities and proxies
loaded by the query will be put in modifiable modethis
, for method chainingPersistenceContext.isDefaultReadOnly()
,
PersistenceContext.setDefaultReadOnly(boolean)
,
Session.setDefaultReadOnly(boolean)
NativeQuery<T> setLockOptions(LockOptions lockOptions)
Query
Set the lock options for the query. Specifically only the following are taken into consideration:<ol>
<li>LockOptions.getLockMode()
</li>
<li>LockOptions.getScope()
</li>
<li>LockOptions.getTimeOut()
</li>
</ol>
For alias-specific locking, use Query.setLockMode(String, LockMode)
.
lockOptions
- The lock options to apply to the query.this
, for method chainingQuery.getLockOptions()
NativeQuery<T> setLockMode(String alias, LockMode lockMode)
Query
Set the LockMode to use for specific alias (as defined in the query’s <tt>FROM</tt> clause).
The alias-specific lock modes specified here are added to the query’s internal
LockOptions
.
The effect of these alias-specific LockModes is somewhat dependent on the driver/database in use. Generally
speaking, for maximum portability, this method should only be used to mark that the rows corresponding to
the given alias should be included in pessimistic locking (LockMode.PESSIMISTIC_WRITE
).
alias
- a query alias, or "this"
for a collection filterlockMode
- The lock mode to apply.this
, for method chainingQuery.getLockOptions()
NativeQuery<T> setComment(String comment)
Query
Set the comment for this query.
comment
- The human-readable commentthis
, for method chainingQuery.getComment()
NativeQuery<T> addQueryHint(String hint)
Query
Add a DB query hint to the SQL. These differ from JPA’s QueryHint
, which is specific
to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the
vendor-specific hints, such as Oracle’s optimizers. Multiple query hints are supported; the Dialect will
determine concatenation and placement.
hint
- The database specific query hint to add.<P> NativeQuery<T> setParameter(QueryParameter<P> parameter, P val)
Query
Bind a query parameter using its inferred Type. If the parameter is
defined in such a way that the Type cannot be inferred from its usage context then
use of this form of binding is not allowed, and Query.setParameter(QueryParameter, Object, Type)
should be used instead
parameter
- The query parameter mementoval
- the possibly-null parameter valuethis
, for method chaining<P> NativeQuery<T> setParameter(Parameter<P> param, P value)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(String name, Object val)
Query
Bind a named query parameter using its inferred Type. If the parameter is
defined in such a way that the Type cannot be inferred from its usage context then
use of this form of binding is not allowed, and Query.setParameter(String, Object, Type)
should be used instead
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
name
- the parameter nameval
- the (possibly-null) parameter valuethis
, for method chainingNativeQuery<T> setParameter(int position, Object val)
Query
Bind a positional query parameter using its inferred Type. If the parameter is
defined in such a way that the Type cannot be inferred from its usage context then
use of this form of binding is not allowed, and Query.setParameter(int, Object, Type)
should be used instead
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
position
- the position of the parameter in the query
string, numbered from <tt>0</tt>.val
- the possibly-null parameter valuethis
, for method chaining<P> NativeQuery<T> setParameter(QueryParameter<P> parameter, P val, Type type)
Query
Bind a query parameter using the supplied Type
parameter
- The query parameter mementoval
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingNativeQuery<T> setParameter(String name, Object val, Type type)
Query
Bind a named query parameter using the supplied Type
name
- the name of the parameterval
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingNativeQuery<T> setParameter(int position, Object val, Type type)
Query
Bind a value to a JDBC-style query parameter.
position
- the position of the parameter in the query
string, numbered from <tt>0</tt>.val
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chaining<P> NativeQuery<T> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
Query
Bind a query parameter as some form of date/time using the indicated temporal-type.
parameter
- The query parameter mementoval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chaining<P> NativeQuery<T> setParameter(String name, P val, TemporalType temporalType)
Query
Bind a named query parameter as some form of date/time using the indicated temporal-type.
name
- the parameter nameval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chaining<P> NativeQuery<T> setParameter(int position, P val, TemporalType temporalType)
Query
Bind a positional query parameter as some form of date/time using the indicated temporal-type.
position
- the position of the parameter in the query
string, numbered from <tt>0</tt>.val
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chaining<P> NativeQuery<T> setParameterList(QueryParameter<P> parameter, Collection<P> values)
Query
Bind multiple values to a query parameter using its inferred Type. The Hibernate type of the parameter values is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the collection. This is useful for binding a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
parameter
- the parameter mementovalues
- a collection of values to listthis
, for method chainingNativeQuery<T> setParameterList(String name, Collection values)
Query
Bind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the collection. This is useful for binding a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingNativeQuery<T> setParameterList(String name, Collection values, Type type)
Query
Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingNativeQuery<T> setParameterList(String name, Object[] values, Type type)
Query
Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingNativeQuery<T> setParameterList(String name, Object[] values)
Query
Bind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the array. This is useful for binding a list of values to an expression such as <tt>foo.bar in (:value_list)</tt>.
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingNativeQuery<T> setProperties(Object bean)
Query
Bind the property values of the given bean to named parameters of the query, matching property names with parameter names and mapping property types to Hibernate types using heuristics.
bean
- any JavaBean or POJOthis
, for method chainingNativeQuery<T> setProperties(Map bean)
Query
Bind the values of the given Map for each named parameters of the query, matching key names with parameter names and mapping value types to Hibernate types using heuristics.
bean
- a java.util.Mapthis
, for method chainingNativeQuery<T> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(String name, Calendar value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(String name, Date value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(int position, Calendar value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setParameter(int position, Date value, TemporalType temporalType)
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
NativeQuery<T> setFlushMode(FlushMode flushMode)
Query
(Re)set the current FlushMode in effect for this query.
setFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chainingQuery.getHibernateFlushMode()
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.