Package org.hibernate
Interface Query<R>
-
- All Superinterfaces:
BasicQueryContract<CommonQueryContract>
,CommonQueryContract
,Query
,TypedQuery<R>
- All Known Subinterfaces:
NativeQuery<T>
,NativeQueryImplementor<T>
,ProcedureCallImplementor<R>
,Query<R>
,QueryImplementor<R>
,SQLQuery<T>
@Deprecated public interface Query<R> extends TypedQuery<R>, CommonQueryContract
Deprecated.(since 5.2) useQuery
insteadRepresents an HQL/JPQL query or a compiled Criteria query
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Query<R>
addQueryHint(java.lang.String hint)
Deprecated.Add a DB query hint to the SQL.Type
determineProperBooleanType(int position, java.lang.Object value, Type defaultType)
Deprecated.added only to allow default method definition for deprecated methods here.Type
determineProperBooleanType(java.lang.String name, java.lang.Object value, Type defaultType)
Deprecated.added only to allow default method definition for deprecated methods here.CacheMode
getCacheMode()
Deprecated.Obtain the CacheMode in effect for this query.java.lang.String
getCacheRegion()
Deprecated.Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onisCacheable()
for more information).java.lang.String
getComment()
Deprecated.Obtain the comment currently associated with this query.java.lang.Integer
getFetchSize()
Deprecated.Obtain the JDBC fetch size hint in effect for this query.FlushModeType
getFlushMode()
Deprecated.For users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPAFlushModeType
rather than Hibernate'sFlushMode
.default java.lang.Integer
getHibernateFirstResult()
Deprecated.Query.getFirstResult()
should be used instead.FlushMode
getHibernateFlushMode()
Deprecated.Obtain the FlushMode in effect for this query.default java.lang.Integer
getHibernateMaxResults()
Deprecated.Query.getMaxResults()
should be used instead.LockOptions
getLockOptions()
Deprecated.Obtains the LockOptions in effect for this query.java.lang.String[]
getNamedParameters()
Deprecated.(since 5.2) useParameterMetadata.getNamedParameterNames()
ParameterMetadata
getParameterMetadata()
Deprecated.Access to information about query parameters.RowSelection
getQueryOptions()
Deprecated."QueryOptions" is a better name, I think, than "RowSelection" -> 6.0java.lang.String
getQueryString()
Deprecated.Get the query string.java.lang.String[]
getReturnAliases()
Deprecated.(since 5.2) useTuple
if you need access to "result variables".Type[]
getReturnTypes()
Deprecated.(since 5.2) with no replacement; to be removed in 6.0java.lang.Integer
getTimeout()
Deprecated.Obtain the query timeout in seconds.boolean
isCacheable()
Deprecated.Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections.boolean
isReadOnly()
Deprecated.Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.java.util.Iterator<R>
iterate()
Deprecated.Return the query results as an Iterator.java.util.List<R>
list()
Deprecated.Return the query results as a List.ScrollableResults
scroll()
Deprecated.Return the query results as ScrollableResults.ScrollableResults
scroll(ScrollMode scrollMode)
Deprecated.Return the query results as ScrollableResults.default Query<R>
setBigDecimal(int position, java.math.BigDecimal val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBigDecimal(java.lang.String name, java.math.BigDecimal val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBigInteger(int position, java.math.BigInteger val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBigInteger(java.lang.String name, java.math.BigInteger val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBinary(int position, byte[] val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBinary(java.lang.String name, byte[] val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBoolean(int position, boolean val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setBoolean(java.lang.String name, boolean val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setByte(int position, byte val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setByte(java.lang.String name, byte val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setCacheable(boolean cacheable)
Deprecated.Enable/disable second level query (result) caching for this query.Query<R>
setCacheMode(CacheMode cacheMode)
Deprecated.(Re)set the current CacheMode in effect for this query.Query<R>
setCacheRegion(java.lang.String cacheRegion)
Deprecated.Set the name of the cache region where query results should be cached (if cached at all).default Query<R>
setCalendar(int position, java.util.Calendar val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setCalendar(java.lang.String name, java.util.Calendar value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setCalendarDate(int position, java.util.Calendar val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setCalendarDate(java.lang.String name, java.util.Calendar value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setCharacter(int position, char val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setCharacter(java.lang.String name, char val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setComment(java.lang.String comment)
Deprecated.Set the comment for this query.default Query<R>
setDate(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setDate(java.lang.String name, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setDouble(int position, double val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setDouble(java.lang.String name, double val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setEntity(int position, java.lang.Object val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setEntity(java.lang.String name, java.lang.Object val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setFetchSize(int fetchSize)
Deprecated.Sets a JDBC fetch size hint for the query.Query<R>
setFirstResult(int startPosition)
Deprecated.default Query<R>
setFloat(int position, float val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setFloat(java.lang.String name, float val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setFlushMode(FlushModeType flushMode)
Deprecated.Query<R>
setFlushMode(FlushMode flushMode)
Deprecated.(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)
insteaddefault Query
setHibernateFirstResult(int firstRow)
Deprecated.setFirstResult(int)
should be used instead.default Query<R>
setHibernateFlushMode(FlushMode flushMode)
Deprecated.(Re)set the current FlushMode in effect for this query.default Query
setHibernateMaxResults(int maxResults)
Deprecated.setMaxResults(int)
should be used instead.Query<R>
setHint(java.lang.String hintName, java.lang.Object value)
Deprecated.default Query<R>
setInteger(int position, int val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setInteger(java.lang.String name, int val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setLocale(int position, java.util.Locale val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setLocale(java.lang.String name, java.util.Locale val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setLockMode(java.lang.String alias, LockMode lockMode)
Deprecated.Set the LockMode to use for specific alias (as defined in the query's FROM clause).Query<R>
setLockMode(LockModeType lockMode)
Deprecated.Query<R>
setLockOptions(LockOptions lockOptions)
Deprecated.Set the lock options for the query.default Query<R>
setLong(int position, long val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setLong(java.lang.String name, long val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setMaxResults(int maxResult)
Deprecated.Query<R>
setParameter(int position, java.lang.Object val)
Deprecated.Bind a positional query parameter using its inferred Type.Query<R>
setParameter(int position, java.lang.Object val, Type type)
Deprecated.Bind a value to a JDBC-style query parameter.Query<R>
setParameter(int position, java.util.Calendar value, TemporalType temporalType)
Deprecated.Query<R>
setParameter(int position, java.util.Date value, TemporalType temporalType)
Deprecated.<P> Query<R>
setParameter(int position, P val, TemporalType temporalType)
Deprecated.Bind a positional query parameter as some form of date/time using the indicated temporal-type.Query<R>
setParameter(java.lang.String name, java.lang.Object val)
Deprecated.Bind a named query parameter using its inferred Type.Query<R>
setParameter(java.lang.String name, java.lang.Object val, Type type)
Deprecated.Bind a named query parameter using the supplied TypeQuery<R>
setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
Deprecated.Query<R>
setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
Deprecated.<P> Query<R>
setParameter(java.lang.String name, P val, TemporalType temporalType)
Deprecated.Bind a named query parameter as some form of date/time using the indicated temporal-type.Query<R>
setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
Deprecated.Query<R>
setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
Deprecated.<T> Query<R>
setParameter(Parameter<T> param, T value)
Deprecated.<P> Query<R>
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> Query<R>
setParameter(QueryParameter<P> parameter, P val, Type type)
Deprecated.Bind a query parameter using the supplied Type<T> Query<R>
setParameter(QueryParameter<T> parameter, T val)
Deprecated.Bind a query parameter using its inferred Type.Query<R>
setParameterList(int position, java.lang.Object[] values)
Deprecated.Query<R>
setParameterList(int position, java.lang.Object[] values, Type type)
Deprecated.Query<R>
setParameterList(int position, java.util.Collection values)
Deprecated.Query<R>
setParameterList(int position, java.util.Collection values, Type type)
Deprecated.Query<R>
setParameterList(java.lang.String name, java.lang.Object[] values)
Deprecated.Bind multiple values to a named query parameter.Query<R>
setParameterList(java.lang.String name, java.lang.Object[] values, Type type)
Deprecated.Bind multiple values to a named query parameter.Query<R>
setParameterList(java.lang.String name, java.util.Collection values)
Deprecated.Bind multiple values to a named query parameter.Query<R>
setParameterList(java.lang.String name, java.util.Collection values, Type type)
Deprecated.Bind multiple values to a named query parameter.<P> Query<R>
setParameterList(QueryParameter<P> parameter, java.util.Collection<P> values)
Deprecated.Bind multiple values to a query parameter using its inferred Type.default Query<R>
setParameters(java.lang.Object[] values, Type[] types)
Deprecated.(since 5.2) Bind values individuallyQuery<R>
setProperties(java.lang.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.Query<R>
setProperties(java.util.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.Query<R>
setReadOnly(boolean readOnly)
Deprecated.Set the read-only/modifiable mode for entities and proxies loaded by this Query.Query<R>
setResultTransformer(ResultTransformer transformer)
Deprecated.(since 5.2)default Query<R>
setSerializable(int position, java.io.Serializable val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setSerializable(java.lang.String name, java.io.Serializable val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setShort(int position, short val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setShort(java.lang.String name, short val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setString(int position, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setString(java.lang.String name, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setText(int position, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setText(java.lang.String name, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setTime(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setTime(java.lang.String name, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadQuery<R>
setTimeout(int timeout)
Deprecated.Set the query timeout in seconds.default Query<R>
setTimestamp(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteaddefault Query<R>
setTimestamp(java.lang.String name, java.util.Date value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadR
uniqueResult()
Deprecated.Convenience method to return a single instance that matches the query, ornull
if the query returns no results.-
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 javax.persistence.TypedQuery
getResultList, getResultStream, getSingleResult
-
-
-
-
Method Detail
-
getQueryString
java.lang.String getQueryString()
Deprecated.Get the query string.- Returns:
- the query string
-
getQueryOptions
RowSelection getQueryOptions()
Deprecated."QueryOptions" is a better name, I think, than "RowSelection" -> 6.0- Returns:
- Return the encapsulation of this query's options, which includes access to firstRow, maxRows, timeout and fetchSize. Important because this gives access to those values in their Integer form rather than the primitive form (int) required by JPA.
-
getHibernateFirstResult
@Deprecated default java.lang.Integer getHibernateFirstResult()
Deprecated.Query.getFirstResult()
should be used instead.The position of the first query result to be retrieved, previously set bysetFirstResult(int)
orsetHibernateFirstResult(int)
. If the value was not initialized bysetFirstResult(int)
orsetHibernateFirstResult(int)
, thennull
is returned, resulting in pagination starting from position 0. IfsetHibernateFirstResult(int)
was called with a negative value, then 0 is returned.- Returns:
- the position of the first query result, or
null
if uninitialized. - See Also:
setFirstResult(int)
,setHibernateFirstResult(int)
-
setHibernateFirstResult
@Deprecated default Query setHibernateFirstResult(int firstRow)
Deprecated.setFirstResult(int)
should be used instead.Set the position of the first query result to be retrieved. A negative value will result in pagination starting from position 0.- Parameters:
firstRow
- - the position of the first query result- Returns:
this
, for method chaining
-
getHibernateMaxResults
@Deprecated default java.lang.Integer getHibernateMaxResults()
Deprecated.Query.getMaxResults()
should be used instead.The maximum number of query results to be retrieved, previously set bysetMaxResults(int)
orsetHibernateMaxResults(int)
. If the value was not initialized bysetMaxResults(int)
orsetHibernateMaxResults(int)
, thennull
is returned IfsetHibernateMaxResults(int)
was called with a value less than or equal to 0, the value is considered to be uninitialized, andnull
is returned, resulting in no limit on the number of results.
-
setHibernateMaxResults
@Deprecated default Query setHibernateMaxResults(int maxResults)
Deprecated.setMaxResults(int)
should be used instead.Set the maximum number of query results to be retrieved. A value less than or equal to 0 is considered uninitialized, resulting in no limit on the number of results.- Parameters:
maxResults
- - the maximum number of query results- Returns:
this
, for method chaining
-
getHibernateFlushMode
FlushMode getHibernateFlushMode()
Deprecated.Obtain the FlushMode in effect for this query. By default, the query inherits the FlushMode of the Session from which it originates.- Specified by:
getHibernateFlushMode
in interfaceBasicQueryContract<R>
- Returns:
- The query FlushMode.
- See Also:
FlushMode
-
setHibernateFlushMode
default Query<R> setHibernateFlushMode(FlushMode flushMode)
Deprecated.(Re)set the current FlushMode in effect for this query.- Specified by:
setHibernateFlushMode
in interfaceBasicQueryContract<R>
- Parameters:
flushMode
- The new FlushMode to use.- Returns:
this
, for method chaining- See Also:
getHibernateFlushMode()
-
setFlushMode
@Deprecated Query<R> setFlushMode(FlushMode flushMode)
Deprecated.(since 5.2) usesetHibernateFlushMode(org.hibernate.FlushMode)
instead(Re)set the current FlushMode in effect for this query.- Specified by:
setFlushMode
in interfaceBasicQueryContract<R>
- Parameters:
flushMode
- The new FlushMode to use.- Returns:
this
, for method chaining- See Also:
getHibernateFlushMode()
-
getFlushMode
FlushModeType getFlushMode()
Deprecated.For users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPAFlushModeType
rather than Hibernate'sFlushMode
. For the former behavior, useQuery.getHibernateFlushMode()
instead.- Specified by:
getFlushMode
in interfaceQuery
- Returns:
- The FlushModeType in effect for this query.
-
getCacheMode
CacheMode getCacheMode()
Deprecated.Obtain the CacheMode in effect for this query. By default, the query inherits the CacheMode of the Session from which is originates. NOTE: The CacheMode here only effects reading/writing of the query cache, not the entity/collection caches.- Specified by:
getCacheMode
in interfaceBasicQueryContract<R>
- Returns:
- The query CacheMode.
- See Also:
Session.getCacheMode()
,CacheMode
-
setCacheMode
Query<R> setCacheMode(CacheMode cacheMode)
Deprecated.(Re)set the current CacheMode in effect for this query.- Specified by:
setCacheMode
in interfaceBasicQueryContract<R>
- Parameters:
cacheMode
- The new CacheMode to use.- Returns:
this
, for method chaining- See Also:
getCacheMode()
-
isCacheable
boolean isCacheable()
Deprecated.Are the results of this query eligible for second level query caching? This is different than second level caching of any returned entities and collections. NOTE: the query being "eligible" for caching does not necessarily mean its results will be cached. Second level query caching still has to be enabled on theSessionFactory
for this to happen. Usually that is controlled by thehibernate.cache.use_query_cache
configuration setting.- Specified by:
isCacheable
in interfaceBasicQueryContract<R>
- Returns:
true
if the query results are eligible for caching,false
otherwise.- See Also:
AvailableSettings.USE_QUERY_CACHE
-
setCacheable
Query<R> setCacheable(boolean cacheable)
Deprecated.Enable/disable second level query (result) caching for this query.- Specified by:
setCacheable
in interfaceBasicQueryContract<R>
- Parameters:
cacheable
- Should the query results be cacheable?- Returns:
this
, for method chaining- See Also:
isCacheable()
-
getCacheRegion
java.lang.String getCacheRegion()
Deprecated.Obtain the name of the second level query cache region in which query results will be stored (if they are cached, see the discussion onisCacheable()
for more information).null
indicates that the default region should be used.- Specified by:
getCacheRegion
in interfaceBasicQueryContract<R>
- Returns:
- The specified cache region name into which query results should be placed;
null
indicates the default region.
-
setCacheRegion
Query<R> setCacheRegion(java.lang.String cacheRegion)
Deprecated.Set the name of the cache region where query results should be cached (if cached at all).- Specified by:
setCacheRegion
in interfaceBasicQueryContract<R>
- 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:
getCacheRegion()
-
getTimeout
java.lang.Integer getTimeout()
Deprecated.Obtain the query timeout in seconds. This value is eventually passed along to the JDBC query viaStatement.setQueryTimeout(int)
. Zero indicates no timeout.- Specified by:
getTimeout
in interfaceBasicQueryContract<R>
- Returns:
- The timeout in seconds
- See Also:
Statement.getQueryTimeout()
,Statement.setQueryTimeout(int)
-
setTimeout
Query<R> setTimeout(int timeout)
Deprecated.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<R>
- Parameters:
timeout
- the timeout in seconds- Returns:
this
, for method chaining- See Also:
getTimeout()
-
getFetchSize
java.lang.Integer getFetchSize()
Deprecated.Obtain the JDBC fetch size hint in effect for this query. This value is eventually passed along to the JDBC query viaStatement.setFetchSize(int)
. As defined b y JDBC, this value is a hint to the driver to indicate how many rows to fetch from the database when more rows are needed. NOTE : JDBC expressly defines this value as a hint. It may or may not have any effect on the actual query execution and ResultSet processing depending on the driver.- Specified by:
getFetchSize
in interfaceBasicQueryContract<R>
- Returns:
- The timeout in seconds
- See Also:
Statement.getFetchSize()
,Statement.setFetchSize(int)
-
setFetchSize
Query<R> setFetchSize(int fetchSize)
Deprecated.Sets a JDBC fetch size hint for the query.- Specified by:
setFetchSize
in interfaceBasicQueryContract<R>
- Parameters:
fetchSize
- the fetch size hint- Returns:
this
, for method chaining- See Also:
getFetchSize()
-
isReadOnly
boolean isReadOnly()
Deprecated.Should entities and proxies loaded by this Query be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.- Specified by:
isReadOnly
in interfaceBasicQueryContract<R>
- Returns:
true
if the entities and proxies loaded by the query will be put in read-only mode;false
otherwise (they will be modifiable)- See Also:
setReadOnly(boolean)
,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.
-
setReadOnly
Query<R> setReadOnly(boolean readOnly)
Deprecated.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<R>
- 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.
-
getReturnTypes
@Deprecated Type[] getReturnTypes()
Deprecated.(since 5.2) with no replacement; to be removed in 6.0Return the Hibernate types of the query results.- Specified by:
getReturnTypes
in interfaceBasicQueryContract<R>
- Returns:
- an array of types
-
getLockOptions
LockOptions getLockOptions()
Deprecated.Obtains the LockOptions in effect for this query.- Returns:
- The LockOptions
- See Also:
LockOptions
-
setLockOptions
Query<R> setLockOptions(LockOptions lockOptions)
Deprecated.Set the lock options for the query. Specifically only the following are taken into consideration: For alias-specific locking, usesetLockMode(String, LockMode)
.- Parameters:
lockOptions
- The lock options to apply to the query.- Returns:
this
, for method chaining- See Also:
getLockOptions()
-
setLockMode
Query<R> setLockMode(java.lang.String alias, LockMode lockMode)
Deprecated.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
).- Parameters:
alias
- a query alias, or"this"
for a collection filterlockMode
- The lock mode to apply.- Returns:
this
, for method chaining- See Also:
getLockOptions()
-
getComment
java.lang.String getComment()
Deprecated.Obtain the comment currently associated with this query. Provided SQL commenting is enabled (generally by enabling thehibernate.use_sql_comments
config setting), this comment will also be added to the SQL query sent to the database. Often useful for identifying the source of troublesome queries on the database side.- Returns:
- The comment.
-
setComment
Query<R> setComment(java.lang.String comment)
Deprecated.Set the comment for this query.- Parameters:
comment
- The human-readable comment- Returns:
this
, for method chaining- See Also:
getComment()
-
addQueryHint
Query<R> addQueryHint(java.lang.String hint)
Deprecated.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.- Parameters:
hint
- The database specific query hint to add.
-
iterate
java.util.Iterator<R> iterate()
Deprecated.Return the query results as an Iterator. If the query contains multiple results per row, the results are returned in an instance of Object[].
Entities returned as results are initialized on demand. The first SQL query returns identifiers only.- Returns:
- the result iterator
-
scroll
ScrollableResults scroll()
Deprecated.Return the query results as ScrollableResults. The scrollability of the returned results depends upon JDBC driver support for scrollable ResultSets.You should call
ScrollableResults.close()
after processing the ScrollableResults so that the underlying resources are deallocated right away.- Returns:
- the result iterator
- See Also:
ScrollableResults
-
scroll
ScrollableResults scroll(ScrollMode scrollMode)
Deprecated.Return the query results as ScrollableResults. The scrollability of the returned results depends upon JDBC driver support for scrollable ResultSets.You should call
ScrollableResults.close()
after processing the ScrollableResults so that the underlying resources are deallocated right away.- Parameters:
scrollMode
- The scroll mode- Returns:
- the result iterator
- See Also:
ScrollableResults
,ScrollMode
-
list
java.util.List<R> list()
Deprecated.Return the query results as a List. If the query contains multiple results per row, the results are returned in an instance of Object[].- Returns:
- the result list
-
uniqueResult
R uniqueResult()
Deprecated.Convenience method to return a single instance that matches the query, ornull
if the query returns no results.- Returns:
- the single result or null
- Throws:
NonUniqueResultException
- if there is more than one matching result
-
getParameterMetadata
ParameterMetadata getParameterMetadata()
Deprecated.Access to information about query parameters.- Returns:
- information about query parameters.
-
getNamedParameters
@Deprecated java.lang.String[] getNamedParameters()
Deprecated.(since 5.2) useParameterMetadata.getNamedParameterNames()
Return the names of all named parameters of the query.- Returns:
- the parameter names, in no particular order
-
setParameter
<T> Query<R> setParameter(QueryParameter<T> parameter, T val)
Deprecated.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, andsetParameter(QueryParameter, Object, Type)
should be used instead- Parameters:
parameter
- The query parameter mementoval
- the possibly-null parameter value- Returns:
this
, for method chaining
-
setParameter
<T> Query<R> setParameter(Parameter<T> param, T value)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(java.lang.String name, java.lang.Object val)
Deprecated.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, andsetParameter(String, Object, Type)
should be used instead- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
- Parameters:
name
- the parameter nameval
- the (possibly-null) parameter value- Returns:
this
, for method chaining
-
setParameter
Query<R> setParameter(int position, java.lang.Object val)
Deprecated.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, andsetParameter(int, Object, Type)
should be used instead- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
- 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
<P> Query<R> setParameter(QueryParameter<P> parameter, P val, Type type)
Deprecated.Bind a query parameter using the supplied Type- Parameters:
parameter
- The query parameter mementoval
- the possibly-null parameter valuetype
- the Hibernate type- Returns:
this
, for method chaining
-
setParameter
Query<R> setParameter(java.lang.String name, java.lang.Object val, Type type)
Deprecated.Bind a named query parameter using the supplied Type- Parameters:
name
- the name of the parameterval
- the possibly-null parameter valuetype
- the Hibernate type- Returns:
this
, for method chaining
-
setParameter
Query<R> setParameter(int position, java.lang.Object val, Type type)
Deprecated.Bind a value to a JDBC-style query parameter.- 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> Query<R> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
Deprecated.Bind a query parameter as some form of date/time using the indicated temporal-type.- 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
<P> Query<R> setParameter(java.lang.String name, P val, TemporalType temporalType)
Deprecated.Bind a named query parameter as some form of date/time using the indicated temporal-type.- 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
<P> Query<R> setParameter(int position, P val, TemporalType temporalType)
Deprecated.Bind a positional query parameter as some form of date/time using the indicated temporal-type.- 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> Query<R> setParameterList(QueryParameter<P> parameter, java.util.Collection<P> values)
Deprecated.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).- Parameters:
parameter
- the parameter mementovalues
- a collection of values to list- Returns:
this
, for method chaining
-
setParameterList
Query<R> setParameterList(java.lang.String name, java.util.Collection values)
Deprecated.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).- Parameters:
name
- the name of the parametervalues
- a collection of values to list- Returns:
this
, for method chaining
-
setParameterList
Query<R> setParameterList(java.lang.String name, java.util.Collection values, Type type)
Deprecated.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).- 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
Query<R> setParameterList(int position, java.util.Collection values, Type type)
Deprecated.
-
setParameterList
Query<R> setParameterList(java.lang.String name, java.lang.Object[] values, Type type)
Deprecated.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).- 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
Query<R> setParameterList(int position, java.lang.Object[] values, Type type)
Deprecated.
-
setParameterList
Query<R> setParameterList(java.lang.String name, java.lang.Object[] values)
Deprecated.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).- Parameters:
name
- the name of the parametervalues
- a collection of values to list- Returns:
this
, for method chaining
-
setProperties
Query<R> setProperties(java.lang.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.- Parameters:
bean
- any JavaBean or POJO- Returns:
this
, for method chaining
-
setProperties
Query<R> setProperties(java.util.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.- Parameters:
bean
- a java.util.Map- Returns:
this
, for method chaining
-
setMaxResults
Query<R> setMaxResults(int maxResult)
Deprecated.- Specified by:
setMaxResults
in interfaceQuery
- Specified by:
setMaxResults
in interfaceTypedQuery<R>
-
setFirstResult
Query<R> setFirstResult(int startPosition)
Deprecated.- Specified by:
setFirstResult
in interfaceQuery
- Specified by:
setFirstResult
in interfaceTypedQuery<R>
-
setHint
Query<R> setHint(java.lang.String hintName, java.lang.Object value)
Deprecated.- Specified by:
setHint
in interfaceQuery
- Specified by:
setHint
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(int position, java.util.Calendar value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setParameter
Query<R> setParameter(int position, java.util.Date value, TemporalType temporalType)
Deprecated.- Specified by:
setParameter
in interfaceQuery
- Specified by:
setParameter
in interfaceTypedQuery<R>
-
setFlushMode
Query<R> setFlushMode(FlushModeType flushMode)
Deprecated.- Specified by:
setFlushMode
in interfaceQuery
- Specified by:
setFlushMode
in interfaceTypedQuery<R>
-
setLockMode
Query<R> setLockMode(LockModeType lockMode)
Deprecated.- Specified by:
setLockMode
in interfaceQuery
- Specified by:
setLockMode
in interfaceTypedQuery<R>
-
setString
@Deprecated default Query<R> setString(int position, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional String-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setCharacter
@Deprecated default Query<R> setCharacter(int position, char val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional char-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setBoolean
@Deprecated default Query<R> setBoolean(int position, boolean val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional boolean-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setByte
@Deprecated default Query<R> setByte(int position, byte val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional byte-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setShort
@Deprecated default Query<R> setShort(int position, short val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional short-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setInteger
@Deprecated default Query<R> setInteger(int position, int val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional int-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setLong
@Deprecated default Query<R> setLong(int position, long val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional long-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setFloat
@Deprecated default Query<R> setFloat(int position, float val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional float-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setDouble
@Deprecated default Query<R> setDouble(int position, double val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional double-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setBinary
@Deprecated default Query<R> setBinary(int position, byte[] val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional binary-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setText
@Deprecated default Query<R> setText(int position, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional String-valued parameter using streaming.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setSerializable
@Deprecated default Query<R> setSerializable(int position, java.io.Serializable val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional binary-valued parameter using serialization.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setLocale
@Deprecated default Query<R> setLocale(int position, java.util.Locale val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Locale-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setBigDecimal
@Deprecated default Query<R> setBigDecimal(int position, java.math.BigDecimal val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional BigDecimal-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setBigInteger
@Deprecated default Query<R> setBigInteger(int position, java.math.BigInteger val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional BigDecimal-valued parameter.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setDate
@Deprecated default Query<R> setDate(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Date-valued parameter using just the Date portion.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setTime
@Deprecated default Query<R> setTime(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Date-valued parameter using just the Time portion.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setTimestamp
@Deprecated default Query<R> setTimestamp(int position, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Date-valued parameter using the full Timestamp.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setCalendar
@Deprecated default Query<R> setCalendar(int position, java.util.Calendar val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Calendar-valued parameter using the full Timestamp portion.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setCalendarDate
@Deprecated default Query<R> setCalendarDate(int position, java.util.Calendar val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a positional Calendar-valued parameter using just the Date portion.- Parameters:
position
- The parameter positionval
- The bind value- Returns:
this
, for method chaining
-
setString
@Deprecated default Query<R> setString(java.lang.String name, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named String-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setCharacter
@Deprecated default Query<R> setCharacter(java.lang.String name, char val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named char-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setBoolean
@Deprecated default Query<R> setBoolean(java.lang.String name, boolean val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named boolean-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setByte
@Deprecated default Query<R> setByte(java.lang.String name, byte val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named byte-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setShort
@Deprecated default Query<R> setShort(java.lang.String name, short val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named short-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setInteger
@Deprecated default Query<R> setInteger(java.lang.String name, int val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named int-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setLong
@Deprecated default Query<R> setLong(java.lang.String name, long val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named long-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setFloat
@Deprecated default Query<R> setFloat(java.lang.String name, float val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named float-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setDouble
@Deprecated default Query<R> setDouble(java.lang.String name, double val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named double-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setBinary
@Deprecated default Query<R> setBinary(java.lang.String name, byte[] val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named binary-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setText
@Deprecated default Query<R> setText(java.lang.String name, java.lang.String val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named String-valued parameter using streaming.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setSerializable
@Deprecated default Query<R> setSerializable(java.lang.String name, java.io.Serializable val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named binary-valued parameter using serialization.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setLocale
@Deprecated default Query<R> setLocale(java.lang.String name, java.util.Locale val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named Locale-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setBigDecimal
@Deprecated default Query<R> setBigDecimal(java.lang.String name, java.math.BigDecimal val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named BigDecimal-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setBigInteger
@Deprecated default Query<R> setBigInteger(java.lang.String name, java.math.BigInteger val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named BigInteger-valued parameter.- Parameters:
name
- The parameter nameval
- The bind value- Returns:
this
, for method chaining
-
setDate
@Deprecated default Query<R> setDate(java.lang.String name, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind the val (time is truncated) of a given Date object to a named query parameter.- Parameters:
name
- The name of the parameterval
- The val object- Returns:
this
, for method chaining
-
setTime
@Deprecated default Query<R> setTime(java.lang.String name, java.util.Date val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind the time (val is truncated) of a given Date object to a named query parameter.- Parameters:
name
- The name of the parameterval
- The val object- Returns:
this
, for method chaining
-
setTimestamp
@Deprecated default Query<R> setTimestamp(java.lang.String name, java.util.Date value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind the value and the time of a given Date object to a named query parameter.- Parameters:
name
- The name of the parametervalue
- The value object- Returns:
this
, for method chaining
-
setCalendar
@Deprecated default Query<R> setCalendar(java.lang.String name, java.util.Calendar value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named Calendar-valued parameter using the full Timestamp.- Parameters:
name
- The parameter namevalue
- The bind value- Returns:
this
, for method chaining
-
setCalendarDate
@Deprecated default Query<R> setCalendarDate(java.lang.String name, java.util.Calendar value)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind a named Calendar-valued parameter using just the Date portion.- Parameters:
name
- The parameter namevalue
- The bind value- Returns:
this
, for method chaining
-
setEntity
@Deprecated Query<R> setEntity(int position, java.lang.Object val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind an instance of a mapped persistent class to a JDBC-style query parameter. UsesetParameter(int, Object)
for null values.- Parameters:
position
- the position of the parameter in the query string, numbered from 0.val
- a non-null instance of a persistent class- Returns:
this
, for method chaining
-
setEntity
@Deprecated Query<R> setEntity(java.lang.String name, java.lang.Object val)
Deprecated.(since 5.2) usesetParameter(int, Object)
orsetParameter(int, Object, Type)
insteadBind an instance of a mapped persistent class to a named query parameter. UsesetParameter(String, Object)
for null values.- Parameters:
name
- the name of the parameterval
- a non-null instance of a persistent class- Returns:
this
, for method chaining
-
determineProperBooleanType
@Deprecated Type determineProperBooleanType(int position, java.lang.Object value, Type defaultType)
Deprecated.added only to allow default method definition for deprecated methods here.
-
determineProperBooleanType
@Deprecated Type determineProperBooleanType(java.lang.String name, java.lang.Object value, Type defaultType)
Deprecated.added only to allow default method definition for deprecated methods here.
-
setResultTransformer
@Deprecated Query<R> setResultTransformer(ResultTransformer transformer)
Deprecated.(since 5.2)Set a strategy for handling the query results. This can be used to change "shape" of the query result.- Parameters:
transformer
- The transformer to apply- Returns:
- this (for method chaining)
-
getReturnAliases
@Deprecated java.lang.String[] getReturnAliases()
Deprecated.(since 5.2) useTuple
if you need access to "result variables".
-
setParameters
@Deprecated default Query<R> setParameters(java.lang.Object[] values, Type[] types)
Deprecated.(since 5.2) Bind values individuallyBind values and types to positional parameters. Allows binding more than one at a time; no real performance impact. The number of elements in each array should match. That is, element number-0 in types array corresponds to element-0 in the values array, etc,- Parameters:
types
- The typesvalues
- The values- Returns:
this
, for method chaining
-
-