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.RootReturnaddRoot(java.lang.String tableAlias, java.lang.String entityName)Add a new root return mapping, returning aSQLQuery.RootReturnto 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).NativeQueryImplementorsetCollectionKey(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
applyFetchGraph, applyGraph, applyLoadGraph, 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:SQLQueryDeclare a scalar query result. Hibernate will attempt to automatically detect the underlying type. Functions like<return-scalar/>inhbm.xmlorColumnResult
-
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:SQLQueryAdd a new root return mapping, returning aSQLQuery.RootReturnto allow further definition.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String entityName)
Description copied from interface:SQLQueryDeclare 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:SQLQueryDeclare a "root" entity.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.String entityName, LockMode lockMode)
Description copied from interface:SQLQueryDeclare a "root" entity, specifying a lock mode.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.Class entityType)
Description copied from interface:SQLQueryDeclare 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:SQLQueryDeclare a "root" entity.
-
addEntity
NativeQueryImplementor<T> addEntity(java.lang.String tableAlias, java.lang.Class entityClass, LockMode lockMode)
Description copied from interface:SQLQueryDeclare a "root" entity, specifying a lock mode.
-
addJoin
NativeQueryImplementor<T> addJoin(java.lang.String tableAlias, java.lang.String path)
Description copied from interface:SQLQueryDeclare a join fetch result.
-
addJoin
NativeQueryImplementor<T> addJoin(java.lang.String tableAlias, java.lang.String ownerTableAlias, java.lang.String joinPropertyName)
Description copied from interface:SQLQueryDeclare a join fetch result.- Specified by:
addJoinin interfaceNativeQuery<T>- Specified by:
addJoinin 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:SQLQueryDeclare a join fetch result, specifying a lock mode.- Specified by:
addJoinin interfaceNativeQuery<T>- Specified by:
addJoinin 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:
setHibernateFlushModein interfaceBasicQueryContract<T>- Specified by:
setHibernateFlushModein interfaceNativeQuery<T>- Specified by:
setHibernateFlushModein interfaceQuery<T>- Specified by:
setHibernateFlushModein interfaceQuery<T>- Specified by:
setHibernateFlushModein 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:
setCacheModein interfaceBasicQueryContract<T>- Specified by:
setCacheModein interfaceNativeQuery<T>- Specified by:
setCacheModein interfaceQuery<T>- Specified by:
setCacheModein interfaceQuery<T>- Specified by:
setCacheModein 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:QueryEnable/disable second level query (result) caching for this query.- Specified by:
setCacheablein interfaceBasicQueryContract<T>- Specified by:
setCacheablein interfaceNativeQuery<T>- Specified by:
setCacheablein interfaceQuery<T>- Specified by:
setCacheablein interfaceQuery<T>- Specified by:
setCacheablein 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:QuerySet the name of the cache region where query results should be cached (if cached at all).- Specified by:
setCacheRegionin interfaceBasicQueryContract<T>- Specified by:
setCacheRegionin interfaceNativeQuery<T>- Specified by:
setCacheRegionin interfaceQuery<T>- Specified by:
setCacheRegionin interfaceQuery<T>- Specified by:
setCacheRegionin interfaceSQLQuery<T>- Parameters:
cacheRegion- the name of a query cache region, ornullto 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:QuerySet 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:
setTimeoutin interfaceBasicQueryContract<T>- Specified by:
setTimeoutin interfaceNativeQuery<T>- Specified by:
setTimeoutin interfaceQuery<T>- Specified by:
setTimeoutin interfaceQuery<T>- Specified by:
setTimeoutin 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:QuerySets a JDBC fetch size hint for the query.- Specified by:
setFetchSizein interfaceBasicQueryContract<T>- Specified by:
setFetchSizein interfaceNativeQuery<T>- Specified by:
setFetchSizein interfaceQuery<T>- Specified by:
setFetchSizein interfaceQuery<T>- Specified by:
setFetchSizein 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:QuerySet 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:
setReadOnlyin interfaceBasicQueryContract<T>- Specified by:
setReadOnlyin interfaceNativeQuery<T>- Specified by:
setReadOnlyin interfaceQuery<T>- Specified by:
setReadOnlyin interfaceQuery<T>- Specified by:
setReadOnlyin interfaceSQLQuery<T>- Parameters:
readOnly-trueindicates that entities and proxies loaded by the query are to be put in read-only mode;falseindicates 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:QuerySet the lock options for the query. Specifically only the following are taken into consideration: For alias-specific locking, useQuery.setLockMode(String, LockMode).- Specified by:
setLockOptionsin interfaceNativeQuery<T>- Specified by:
setLockOptionsin interfaceQuery<T>- Specified by:
setLockOptionsin interfaceQuery<T>- Specified by:
setLockOptionsin 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:QuerySet 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:
setLockModein interfaceNativeQuery<T>- Specified by:
setLockModein interfaceQuery<T>- Specified by:
setLockModein interfaceQuery<T>- Specified by:
setLockModein 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:QuerySet the comment for this query.- Specified by:
setCommentin interfaceNativeQuery<T>- Specified by:
setCommentin interfaceQuery<T>- Specified by:
setCommentin interfaceQuery<T>- Specified by:
setCommentin 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:QueryAdd 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:
addQueryHintin interfaceNativeQuery<T>- Specified by:
addQueryHintin interfaceQuery<T>- Specified by:
addQueryHintin interfaceQuery<T>- Specified by:
addQueryHintin 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:QueryBind 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:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.lang.Object val)
Description copied from interface:QueryBind 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:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin 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:QueryBind a query parameter using the supplied Type- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind 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:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin 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:QueryBind a named query parameter using the supplied Type- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind a value to a JDBC-style query parameter.- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind a query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind a named query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind a positional query parameter as some form of date/time using the indicated temporal-type.- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin 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:QueryBind 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:
setParameterListin interfaceNativeQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin 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:QueryBind 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:
setParameterListin interfaceNativeQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin 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:QueryBind 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:
setParameterListin interfaceNativeQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin 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:QueryBind 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:
setParameterListin interfaceNativeQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin 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:QueryBind 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:
setParameterListin interfaceNativeQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin interfaceQuery<T>- Specified by:
setParameterListin 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:QueryBind 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:
setPropertiesin interfaceNativeQuery<T>- Specified by:
setPropertiesin interfaceQuery<T>- Specified by:
setPropertiesin interfaceQuery<T>- Specified by:
setPropertiesin 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:QueryBind 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:
setPropertiesin interfaceNativeQuery<T>- Specified by:
setPropertiesin interfaceQuery<T>- Specified by:
setPropertiesin interfaceQuery<T>- Specified by:
setPropertiesin 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:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.util.Calendar value, TemporalType temporalType)
- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
setParameter
NativeQueryImplementor<T> setParameter(int position, java.util.Date value, TemporalType temporalType)
- Specified by:
setParameterin interfaceNativeQuery<T>- Specified by:
setParameterin interfaceQuery- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceQuery<T>- Specified by:
setParameterin interfaceSQLQuery<T>- Specified by:
setParameterin interfaceTypedQuery<T>
-
addSynchronizedQuerySpace
NativeQueryImplementor<T> addSynchronizedQuerySpace(java.lang.String querySpace)
Description copied from interface:SynchronizeableQueryAdds a query space.- Specified by:
addSynchronizedQuerySpacein interfaceNativeQuery<T>- Specified by:
addSynchronizedQuerySpacein interfaceSQLQuery<T>- Specified by:
addSynchronizedQuerySpacein 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:SynchronizeableQueryAdds 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:
addSynchronizedEntityNamein interfaceNativeQuery<T>- Specified by:
addSynchronizedEntityNamein interfaceSQLQuery<T>- Specified by:
addSynchronizedEntityNamein 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:
setFlushModein interfaceBasicQueryContract<T>- Specified by:
setFlushModein interfaceNativeQuery<T>- Specified by:
setFlushModein interfaceQuery<T>- Specified by:
setFlushModein interfaceQuery<T>- Specified by:
setFlushModein 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:SynchronizeableQueryAdds 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:
addSynchronizedEntityClassin interfaceNativeQuery<T>- Specified by:
addSynchronizedEntityClassin interfaceSQLQuery<T>- Specified by:
addSynchronizedEntityClassin 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
-
-