Package org.hibernate.query.spi
Interface NativeQueryImplementor<T>
-
- All Superinterfaces:
BasicQueryContract<CommonQueryContract>
,CommonQueryContract
,NativeQuery<T>
,Query
,Query<T>
,Query<T>
,QueryImplementor<T>
,SQLQuery<T>
,SynchronizeableQuery<T>
,TypedQuery<T>
public interface NativeQueryImplementor<T> extends QueryImplementor<T>, NativeQuery<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.SQLQuery
SQLQuery.FetchReturn, SQLQuery.ReturnProperty, SQLQuery.RootReturn
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NativeQueryImplementor<T>
addEntity(java.lang.Class entityType)
Declare a "root" entity, without specifying an alias.NativeQueryImplementor<T>
addEntity(java.lang.String entityName)
Declare a "root" entity, without specifying an alias.NativeQueryImplementor<T>
addEntity(java.lang.String tableAlias, java.lang.Class entityType)
Declare a "root" entity.NativeQueryImplementor<T>
addEntity(java.lang.String tableAlias, java.lang.Class entityClass, LockMode lockMode)
Declare a "root" entity, specifying a lock mode.NativeQueryImplementor<T>
addEntity(java.lang.String tableAlias, java.lang.String entityName)
Declare a "root" entity.NativeQueryImplementor<T>
addEntity(java.lang.String tableAlias, java.lang.String entityName, LockMode lockMode)
Declare a "root" entity, specifying a lock mode.NativeQueryImplementor<T>
addJoin(java.lang.String tableAlias, java.lang.String path)
Declare a join fetch result.NativeQueryImplementor<T>
addJoin(java.lang.String tableAlias, java.lang.String ownerTableAlias, java.lang.String joinPropertyName)
Declare a join fetch result.NativeQueryImplementor<T>
addJoin(java.lang.String tableAlias, java.lang.String path, LockMode lockMode)
Declare a join fetch result, specifying a lock mode.NativeQueryImplementor<T>
addQueryHint(java.lang.String hint)
Add a DB query hint to the SQL.SQLQuery.RootReturn
addRoot(java.lang.String tableAlias, java.lang.String entityName)
Add a new root return mapping, returning aSQLQuery.RootReturn
to allow further definition.NativeQueryImplementor<T>
addScalar(java.lang.String columnAlias)
Declare a scalar query result.NativeQueryImplementor<T>
addScalar(java.lang.String columnAlias, Type type)
Declare a scalar query result.NativeQueryImplementor<T>
addSynchronizedEntityClass(java.lang.Class entityClass)
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking.NativeQueryImplementor<T>
addSynchronizedEntityName(java.lang.String entityName)
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking.NativeQueryImplementor<T>
addSynchronizedQuerySpace(java.lang.String querySpace)
Adds a query space.NativeQueryImplementor<T>
setCacheable(boolean cacheable)
Enable/disable second level query (result) caching for this query.NativeQueryImplementor<T>
setCacheMode(CacheMode cacheMode)
(Re)set the current CacheMode in effect for this query.NativeQueryImplementor<T>
setCacheRegion(java.lang.String cacheRegion)
Set the name of the cache region where query results should be cached (if cached at all).NativeQueryImplementor
setCollectionKey(java.io.Serializable key)
NativeQueryImplementor<T>
setComment(java.lang.String comment)
Set the comment for this query.NativeQueryImplementor<T>
setFetchSize(int fetchSize)
Sets a JDBC fetch size hint for the query.NativeQueryImplementor<T>
setFlushMode(FlushMode flushMode)
(Re)set the current FlushMode in effect for this query.NativeQueryImplementor<T>
setHibernateFlushMode(FlushMode flushMode)
(Re)set the current FlushMode in effect for this query.NativeQueryImplementor<T>
setLockMode(java.lang.String alias, LockMode lockMode)
Set the LockMode to use for specific alias (as defined in the query's FROM clause).NativeQueryImplementor<T>
setLockOptions(LockOptions lockOptions)
Set the lock options for the query.NativeQueryImplementor<T>
setParameter(int position, java.lang.Object val)
Bind a positional query parameter using its inferred Type.NativeQueryImplementor<T>
setParameter(int position, java.lang.Object val, TemporalType temporalType)
Bind a positional query parameter as some form of date/time using the indicated temporal-type.NativeQueryImplementor<T>
setParameter(int position, java.lang.Object val, Type type)
Bind a value to a JDBC-style query parameter.NativeQueryImplementor<T>
setParameter(int position, java.util.Calendar value, TemporalType temporalType)
NativeQueryImplementor<T>
setParameter(int position, java.util.Date value, TemporalType temporalType)
NativeQueryImplementor<T>
setParameter(java.lang.String name, java.lang.Object val)
Bind a named query parameter using its inferred Type.NativeQueryImplementor<T>
setParameter(java.lang.String name, java.lang.Object val, TemporalType temporalType)
Bind a named query parameter as some form of date/time using the indicated temporal-type.NativeQueryImplementor<T>
setParameter(java.lang.String name, java.lang.Object val, Type type)
Bind a named query parameter using the supplied TypeNativeQueryImplementor<T>
setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
NativeQueryImplementor<T>
setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
NativeQueryImplementor<T>
setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
NativeQueryImplementor<T>
setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
<P> NativeQueryImplementor<T>
setParameter(Parameter<P> param, P value)
<P> NativeQueryImplementor<T>
setParameter(QueryParameter<P> parameter, P val)
Bind a query parameter using its inferred Type.<P> NativeQueryImplementor<T>
setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
Bind a query parameter as some form of date/time using the indicated temporal-type.<P> NativeQueryImplementor<T>
setParameter(QueryParameter<P> parameter, P val, Type type)
Bind a query parameter using the supplied TypeNativeQueryImplementor<T>
setParameterList(java.lang.String name, java.lang.Object[] values)
Bind multiple values to a named query parameter.NativeQueryImplementor<T>
setParameterList(java.lang.String name, java.lang.Object[] values, Type type)
Bind multiple values to a named query parameter.NativeQueryImplementor<T>
setParameterList(java.lang.String name, java.util.Collection values)
Bind multiple values to a named query parameter.NativeQueryImplementor<T>
setParameterList(java.lang.String name, java.util.Collection values, Type type)
Bind multiple values to a named query parameter.<P> NativeQueryImplementor<T>
setParameterList(QueryParameter<P> parameter, java.util.Collection<P> values)
Bind multiple values to a query parameter using its inferred Type.NativeQueryImplementor<T>
setProperties(java.lang.Object bean)
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.NativeQueryImplementor<T>
setProperties(java.util.Map bean)
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.NativeQueryImplementor<T>
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies loaded by this Query.NativeQueryImplementor<T>
setTimeout(int timeout)
Set the query timeout in seconds.-
Methods inherited from interface org.hibernate.query.NativeQuery
addFetch, addRoot, isCallable, setFirstResult, setFlushMode, setHint, setLockMode, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setParameter, setResultSetMapping
-
Methods inherited from interface javax.persistence.Query
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
-
Methods inherited from interface org.hibernate.Query
determineProperBooleanType, determineProperBooleanType, getFlushMode, getHibernateFirstResult, getHibernateMaxResults, getNamedParameters, getQueryOptions, getReturnAliases, getReturnTypes, getTimeout, isCacheable, isReadOnly, iterate, setHibernateFirstResult, setHibernateMaxResults, setParameterList, setParameterList, setParameterList, setParameterList
-
Methods inherited from interface org.hibernate.query.Query
getCacheMode, getCacheRegion, getComment, getFetchSize, getHibernateFlushMode, getLockOptions, getParameterMetadata, getQueryString, getResultList, getResultStream, getSingleResult, 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, setFloat, setFloat, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setParameters, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp, stream, uniqueResult, uniqueResultOptional
-
Methods inherited from interface org.hibernate.query.spi.QueryImplementor
getProducer, setOptionalEntityName, setOptionalId, setOptionalObject
-
Methods inherited from interface org.hibernate.SQLQuery
getQueryReturns
-
Methods inherited from interface org.hibernate.SynchronizeableQuery
addSynchronizedEntityClass, addSynchronizedEntityName, addSynchronizedQuerySpace, addSynchronizedTable, addSynchronizedTable, getSynchronizedQuerySpaces
-
-
-
-
Method Detail
-
setCollectionKey
NativeQueryImplementor setCollectionKey(java.io.Serializable key)
-
addScalar
NativeQueryImplementor<T> addScalar(java.lang.String columnAlias)
Description copied from interface:SQLQuery
Declare a scalar query result. Hibernate will attempt to automatically detect the underlying type. Functions like<return-scalar/>
inhbm.xml
orColumnResult
-
addScalar
NativeQueryImplementor<T> addScalar(java.lang.String columnAlias, Type type)
Description copied from interface:SQLQuery
-
addRoot
SQLQuery.RootReturn addRoot(java.lang.String tableAlias, java.lang.String entityName)
Description copied from interface:SQLQuery
Add a new root return mapping, returning aSQLQuery.RootReturn
to allow further definition.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String entityName)
Description copied from interface:SQLQuery
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name UseSQLQuery.addRoot(java.lang.String, java.lang.String)
if you need further control of the mapping
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.String entityName)
Description copied from interface:SQLQuery
Declare a "root" entity.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.String entityName, LockMode lockMode)
Description copied from interface:SQLQuery
Declare a "root" entity, specifying a lock mode.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.Class entityType)
Description copied from interface:SQLQuery
Declare a "root" entity, without specifying an alias. The expectation here is that the table alias is the same as the unqualified entity name
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.Class entityType)
Description copied from interface:SQLQuery
Declare a "root" entity.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.Class entityClass, LockMode lockMode)
Description copied from interface:SQLQuery
Declare a "root" entity, specifying a lock mode.
-
addJoin
NativeQueryImplementor<T> addJoin(java.lang.String tableAlias, java.lang.String path)
Description copied from interface:SQLQuery
Declare a join fetch result.
-
addJoin
NativeQueryImplementor<T> addJoin(java.lang.String tableAlias, java.lang.String ownerTableAlias, java.lang.String joinPropertyName)
Description copied from interface:SQLQuery
Declare a join fetch result.- Specified by:
addJoin
in interfaceNativeQuery<T>
- Specified by:
addJoin
in interfaceSQLQuery<T>
- Parameters:
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.- Returns:
this
, for method chaining
-
addJoin
NativeQueryImplementor<T> addJoin(java.lang.String tableAlias, java.lang.String path, LockMode lockMode)
Description copied from interface:SQLQuery
Declare a join fetch result, specifying a lock mode.- Specified by:
addJoin
in interfaceNativeQuery<T>
- Specified by:
addJoin
in interfaceSQLQuery<T>
- Parameters:
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.- Returns:
this
, for method chaining
-
setHibernateFlushMode
NativeQueryImplementor<T> setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:Query
(Re)set the current FlushMode in effect for this query.- Specified by:
setHibernateFlushMode
in interfaceBasicQueryContract<T>
- Specified by:
setHibernateFlushMode
in interfaceNativeQuery<T>
- Specified by:
setHibernateFlushMode
in interfaceQuery<T>
- Specified by:
setHibernateFlushMode
in interfaceQuery<T>
- Specified by:
setHibernateFlushMode
in interfaceSQLQuery<T>
- Parameters:
flushMode
- The new FlushMode to use.- Returns:
this
, for method chaining- See Also:
Query.getHibernateFlushMode()
-
setCacheMode
NativeQueryImplementor<T> setCacheMode(CacheMode cacheMode)
Description copied from interface:Query
(Re)set the current CacheMode in effect for this query.- Specified by:
setCacheMode
in interfaceBasicQueryContract<T>
- Specified by:
setCacheMode
in interfaceNativeQuery<T>
- Specified by:
setCacheMode
in interfaceQuery<T>
- Specified by:
setCacheMode
in interfaceQuery<T>
- Specified by:
setCacheMode
in interfaceSQLQuery<T>
- Parameters:
cacheMode
- The new CacheMode to use.- Returns:
this
, for method chaining- See Also:
Query.getCacheMode()
-
setCacheable
NativeQueryImplementor<T> setCacheable(boolean cacheable)
Description copied from interface:Query
Enable/disable second level query (result) caching for this query.- Specified by:
setCacheable
in interfaceBasicQueryContract<T>
- Specified by:
setCacheable
in interfaceNativeQuery<T>
- Specified by:
setCacheable
in interfaceQuery<T>
- Specified by:
setCacheable
in interfaceQuery<T>
- Specified by:
setCacheable
in interfaceSQLQuery<T>
- Parameters:
cacheable
- Should the query results be cacheable?- Returns:
this
, for method chaining- See Also:
Query.isCacheable()
-
setCacheRegion
NativeQueryImplementor<T> setCacheRegion(java.lang.String cacheRegion)
Description copied from interface:Query
Set the name of the cache region where query results should be cached (if cached at all).- Specified by:
setCacheRegion
in interfaceBasicQueryContract<T>
- Specified by:
setCacheRegion
in interfaceNativeQuery<T>
- Specified by:
setCacheRegion
in interfaceQuery<T>
- Specified by:
setCacheRegion
in interfaceQuery<T>
- Specified by:
setCacheRegion
in interfaceSQLQuery<T>
- Parameters:
cacheRegion
- the name of a query cache region, ornull
to indicate that the default region should be used.- Returns:
this
, for method chaining- See Also:
Query.getCacheRegion()
-
setTimeout
NativeQueryImplementor<T> setTimeout(int timeout)
Description copied from interface:Query
Set the query timeout in seconds. 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.- Specified by:
setTimeout
in interfaceBasicQueryContract<T>
- Specified by:
setTimeout
in interfaceNativeQuery<T>
- Specified by:
setTimeout
in interfaceQuery<T>
- Specified by:
setTimeout
in interfaceQuery<T>
- Specified by:
setTimeout
in interfaceSQLQuery<T>
- Parameters:
timeout
- the timeout in seconds- Returns:
this
, for method chaining- See Also:
Query.getTimeout()
-
setFetchSize
NativeQueryImplementor<T> setFetchSize(int fetchSize)
Description copied from interface:Query
Sets a JDBC fetch size hint for the query.- Specified by:
setFetchSize
in interfaceBasicQueryContract<T>
- Specified by:
setFetchSize
in interfaceNativeQuery<T>
- Specified by:
setFetchSize
in interfaceQuery<T>
- Specified by:
setFetchSize
in interfaceQuery<T>
- Specified by:
setFetchSize
in interfaceSQLQuery<T>
- Parameters:
fetchSize
- the fetch size hint- Returns:
this
, for method chaining- See Also:
Query.getFetchSize()
-
setReadOnly
NativeQueryImplementor<T> setReadOnly(boolean readOnly)
Description copied from interface: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.- Specified by:
setReadOnly
in interfaceBasicQueryContract<T>
- Specified by:
setReadOnly
in interfaceNativeQuery<T>
- Specified by:
setReadOnly
in interfaceQuery<T>
- Specified by:
setReadOnly
in interfaceQuery<T>
- Specified by:
setReadOnly
in interfaceSQLQuery<T>
- Parameters:
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 mode- Returns:
this
, for method chaining- See Also:
To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session:
,PersistenceContext.setDefaultReadOnly(boolean)
,Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session's current setting. The read-only/modifiable setting has no impact on entities/proxies returned by the query that existed in the session before the query was executed.
-
setLockOptions
NativeQueryImplementor<T> setLockOptions(LockOptions lockOptions)
Description copied from interface:Query
Set the lock options for the query. Specifically only the following are taken into consideration: For alias-specific locking, useQuery.setLockMode(String, LockMode)
.- Specified by:
setLockOptions
in interfaceNativeQuery<T>
- Specified by:
setLockOptions
in interfaceQuery<T>
- Specified by:
setLockOptions
in interfaceQuery<T>
- Specified by:
setLockOptions
in interfaceSQLQuery<T>
- Parameters:
lockOptions
- The lock options to apply to the query.- Returns:
this
, for method chaining- See Also:
Query.getLockOptions()
-
setLockMode
NativeQueryImplementor<T> setLockMode(java.lang.String alias, LockMode lockMode)
Description copied from interface:Query
Set the LockMode to use for specific alias (as defined in the query's FROM clause). The alias-specific lock modes specified here are added to the query's internalLockOptions
. 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
).- Specified by:
setLockMode
in interfaceNativeQuery<T>
- Specified by:
setLockMode
in interfaceQuery<T>
- Specified by:
setLockMode
in interfaceQuery<T>
- Specified by:
setLockMode
in interfaceSQLQuery<T>
- Parameters:
alias
- a query alias, or"this"
for a collection filterlockMode
- The lock mode to apply.- Returns:
this
, for method chaining- See Also:
Query.getLockOptions()
-
setComment
NativeQueryImplementor<T> setComment(java.lang.String comment)
Description copied from interface:Query
Set the comment for this query.- Specified by:
setComment
in interfaceNativeQuery<T>
- Specified by:
setComment
in interfaceQuery<T>
- Specified by:
setComment
in interfaceQuery<T>
- Specified by:
setComment
in interfaceSQLQuery<T>
- Parameters:
comment
- The human-readable comment- Returns:
this
, for method chaining- See Also:
Query.getComment()
-
addQueryHint
NativeQueryImplementor<T> addQueryHint(java.lang.String hint)
Description copied from interface:Query
Add a DB query hint to the SQL. These differ from JPA'sQueryHint
, 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.- Specified by:
addQueryHint
in interfaceNativeQuery<T>
- Specified by:
addQueryHint
in interfaceQuery<T>
- Specified by:
addQueryHint
in interfaceQuery<T>
- Specified by:
addQueryHint
in interfaceSQLQuery<T>
- Parameters:
hint
- The database specific query hint to add.
-
setParameter
<P> NativeQueryImplementor<T> setParameter(QueryParameter<P> parameter, P val)
Description copied from interface: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, andQuery.setParameter(QueryParameter, Object, Type)
should be used instead- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
parameter
- The query parameter mementoval
- the possibly-null parameter value- Returns:
this
, for method chaining
-
setParameter
<P> NativeQueryImplementor<T> setParameter(Parameter<P> param, P value)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.lang.Object val)
Description copied from interface: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, andQuery.setParameter(String, Object, Type)
should be used instead- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
- Parameters:
name
- the parameter nameval
- the (possibly-null) parameter value- Returns:
this
, for method chaining
-
setParameter
<P> NativeQueryImplementor<T> setParameter(QueryParameter<P> parameter, P val, Type type)
Description copied from interface:Query
Bind a query parameter using the supplied Type- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
parameter
- The query parameter mementoval
- the possibly-null parameter valuetype
- the Hibernate type- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.lang.Object val)
Description copied from interface: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, andQuery.setParameter(int, Object, Type)
should be used instead- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
- Parameters:
position
- the position of the parameter in the query string, numbered from 0.val
- the possibly-null parameter value- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.lang.Object val, Type type)
Description copied from interface:Query
Bind a named query parameter using the supplied Type- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
name
- the name of the parameterval
- the possibly-null parameter valuetype
- the Hibernate type- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.lang.Object val, Type type)
Description copied from interface:Query
Bind a value to a JDBC-style query parameter.- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
position
- the position of the parameter in the query string, numbered from 0.val
- the possibly-null parameter valuetype
- the Hibernate type- Returns:
this
, for method chaining
-
setParameter
<P> NativeQueryImplementor<T> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
Description copied from interface:Query
Bind a query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
parameter
- The query parameter mementoval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/time- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.lang.Object val, TemporalType temporalType)
Description copied from interface:Query
Bind a named query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
name
- the parameter nameval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/time- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.lang.Object val, TemporalType temporalType)
Description copied from interface:Query
Bind a positional query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Parameters:
position
- the position of the parameter in the query string, numbered from 0.val
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/time- Returns:
this
, for method chaining
-
setParameterList
<P> NativeQueryImplementor<T> setParameterList(QueryParameter<P> parameter, java.util.Collection<P> values)
Description copied from interface: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 foo.bar in (:value_list).- Specified by:
setParameterList
in interfaceNativeQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceSQLQuery<T>
- Parameters:
parameter
- the parameter mementovalues
- a collection of values to list- Returns:
this
, for method chaining
-
setParameterList
NativeQueryImplementor<T> setParameterList(java.lang.String name, java.util.Collection values)
Description copied from interface: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 foo.bar in (:value_list).- Specified by:
setParameterList
in interfaceNativeQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceSQLQuery<T>
- Parameters:
name
- the name of the parametervalues
- a collection of values to list- Returns:
this
, for method chaining
-
setParameterList
NativeQueryImplementor<T> setParameterList(java.lang.String name, java.util.Collection values, Type type)
Description copied from interface:Query
Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- Specified by:
setParameterList
in interfaceNativeQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceSQLQuery<T>
- Parameters:
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the values- Returns:
this
, for method chaining
-
setParameterList
NativeQueryImplementor<T> setParameterList(java.lang.String name, java.lang.Object[] values, Type type)
Description copied from interface:Query
Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).- Specified by:
setParameterList
in interfaceNativeQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceSQLQuery<T>
- Parameters:
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the values- Returns:
this
, for method chaining
-
setParameterList
NativeQueryImplementor<T> setParameterList(java.lang.String name, java.lang.Object[] values)
Description copied from interface: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 foo.bar in (:value_list).- Specified by:
setParameterList
in interfaceNativeQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceQuery<T>
- Specified by:
setParameterList
in interfaceSQLQuery<T>
- Parameters:
name
- the name of the parametervalues
- a collection of values to list- Returns:
this
, for method chaining
-
setProperties
NativeQueryImplementor<T> setProperties(java.lang.Object bean)
Description copied from interface: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.- Specified by:
setProperties
in interfaceNativeQuery<T>
- Specified by:
setProperties
in interfaceQuery<T>
- Specified by:
setProperties
in interfaceQuery<T>
- Specified by:
setProperties
in interfaceSQLQuery<T>
- Parameters:
bean
- any JavaBean or POJO- Returns:
this
, for method chaining
-
setProperties
NativeQueryImplementor<T> setProperties(java.util.Map bean)
Description copied from interface: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.- Specified by:
setProperties
in interfaceNativeQuery<T>
- Specified by:
setProperties
in interfaceQuery<T>
- Specified by:
setProperties
in interfaceQuery<T>
- Specified by:
setProperties
in interfaceSQLQuery<T>
- Parameters:
bean
- a java.util.Map- Returns:
this
, for method chaining
-
setParameter
NativeQueryImplementor<T> setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.util.Date value, TemporalType temporalType)
- Specified by:
setParameter
in interfaceNativeQuery<T>
- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceQuery<T>
- Specified by:
setParameter
in interfaceSQLQuery<T>
- Specified by:
setParameter
in interfaceTypedQuery<T>
-
addSynchronizedQuerySpace
NativeQueryImplementor<T> addSynchronizedQuerySpace(java.lang.String querySpace)
Description copied from interface:SynchronizeableQuery
Adds a query space.- Specified by:
addSynchronizedQuerySpace
in interfaceNativeQuery<T>
- Specified by:
addSynchronizedQuerySpace
in interfaceSQLQuery<T>
- Specified by:
addSynchronizedQuerySpace
in interfaceSynchronizeableQuery<T>
- Parameters:
querySpace
- The query space to be auto-flushed for this query.- Returns:
this
, for method chaining
-
addSynchronizedEntityName
NativeQueryImplementor<T> addSynchronizedEntityName(java.lang.String entityName) throws MappingException
Description copied from interface:SynchronizeableQuery
Adds an entity name for (a) auto-flush checking and (b) query result cache invalidation checking. Same asSynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.- Specified by:
addSynchronizedEntityName
in interfaceNativeQuery<T>
- Specified by:
addSynchronizedEntityName
in interfaceSQLQuery<T>
- Specified by:
addSynchronizedEntityName
in interfaceSynchronizeableQuery<T>
- Parameters:
entityName
- The name of the entity upon whose defined query spaces we should additionally synchronize.- Returns:
this
, for method chaining- Throws:
MappingException
- Indicates the given name could not be resolved as an entity
-
setFlushMode
NativeQueryImplementor<T> setFlushMode(FlushMode flushMode)
Description copied from interface:Query
(Re)set the current FlushMode in effect for this query.- Specified by:
setFlushMode
in interfaceBasicQueryContract<T>
- Specified by:
setFlushMode
in interfaceNativeQuery<T>
- Specified by:
setFlushMode
in interfaceQuery<T>
- Specified by:
setFlushMode
in interfaceQuery<T>
- Specified by:
setFlushMode
in interfaceSQLQuery<T>
- Parameters:
flushMode
- The new FlushMode to use.- Returns:
this
, for method chaining- See Also:
Query.getHibernateFlushMode()
-
addSynchronizedEntityClass
NativeQueryImplementor<T> addSynchronizedEntityClass(java.lang.Class entityClass) throws MappingException
Description copied from interface:SynchronizeableQuery
Adds an entity for (a) auto-flush checking and (b) query result cache invalidation checking. Same asSynchronizeableQuery.addSynchronizedQuerySpace(java.lang.String)
for all tables associated with the given entity.- Specified by:
addSynchronizedEntityClass
in interfaceNativeQuery<T>
- Specified by:
addSynchronizedEntityClass
in interfaceSQLQuery<T>
- Specified by:
addSynchronizedEntityClass
in interfaceSynchronizeableQuery<T>
- Parameters:
entityClass
- The class of the entity upon whose defined query spaces we should additionally synchronize.- Returns:
this
, for method chaining- Throws:
MappingException
- Indicates the given class could not be resolved as an entity
-
-