Query
instead@Deprecated public interface Query<R> extends TypedQuery<R>, CommonQueryContract
Modifier and Type | Method and Description |
---|---|
Query<R> |
addQueryHint(String hint)
Deprecated.
Add a DB query hint to the SQL.
|
Type |
determineProperBooleanType(int position,
Object value,
Type defaultType)
Deprecated.
added only to allow default method definition for deprecated methods here.
|
Type |
determineProperBooleanType(String name,
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.
|
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 on
isCacheable() for more information). |
String |
getComment()
Deprecated.
Obtain the comment currently associated with this query.
|
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 JPA
FlushModeType rather than Hibernate's FlushMode . |
default Integer |
getHibernateFirstResult()
Deprecated.
Query.getFirstResult() should be used instead. |
FlushMode |
getHibernateFlushMode()
Deprecated.
Obtain the FlushMode in effect for this query.
|
default Integer |
getHibernateMaxResults()
Deprecated.
Query.getMaxResults() should be used instead. |
LockOptions |
getLockOptions()
Deprecated.
Obtains the LockOptions in effect for this query.
|
String[] |
getNamedParameters()
Deprecated.
(since 5.2) use
ParameterMetadata.getNamedParameterNames() |
ParameterMetadata |
getParameterMetadata()
Deprecated.
Access to information about query parameters.
|
RowSelection |
getQueryOptions()
Deprecated.
"QueryOptions" is a better name, I think, than "RowSelection" -> 6.0
|
String |
getQueryString()
Deprecated.
Get the query string.
|
String[] |
getReturnAliases()
Deprecated.
(since 5.2) use
Tuple if you need access to "result variables". |
Type[] |
getReturnTypes()
Deprecated.
(since 5.2) with no replacement; to be removed in 6.0
|
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 that 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.
|
Iterator<R> |
iterate()
Deprecated.
Return the query results as an Iterator.
|
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,
BigDecimal val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBigDecimal(String name,
BigDecimal val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBigInteger(int position,
BigInteger val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBigInteger(String name,
BigInteger val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBinary(int position,
byte[] val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBinary(String name,
byte[] val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBoolean(int position,
boolean val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setBoolean(String name,
boolean val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setByte(int position,
byte val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setByte(String name,
byte val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<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(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,
Calendar val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setCalendar(String name,
Calendar value)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setCalendarDate(int position,
Calendar val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setCalendarDate(String name,
Calendar value)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setCharacter(int position,
char val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setCharacter(String name,
char val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setComment(String comment)
Deprecated.
Set the comment for this query.
|
default Query<R> |
setDate(int position,
Date val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setDate(String name,
Date val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setDouble(int position,
double val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setDouble(String name,
double val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setEntity(int position,
Object val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setEntity(String name,
Object val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setFetchSize(int fetchSize)
Deprecated.
Sets a JDBC fetch size hint for the query.
|
Query<R> |
setFirstResult(int startPosition)
Deprecated.
Set the position of the first result to retrieve.
|
default Query<R> |
setFloat(int position,
float val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setFloat(String name,
float val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setFlushMode(FlushMode flushMode)
Deprecated.
(since 5.2) use
setHibernateFlushMode(org.hibernate.FlushMode) instead |
Query<R> |
setFlushMode(FlushModeType flushMode)
Deprecated.
Set the flush mode type to be used for the query execution.
|
default 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(String hintName,
Object value)
Deprecated.
Set a query property or hint.
|
default Query<R> |
setInteger(int position,
int val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setInteger(String name,
int val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setLocale(int position,
Locale val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setLocale(String name,
Locale val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setLockMode(LockModeType lockMode)
Deprecated.
Set the lock mode type to be used for the query execution.
|
Query<R> |
setLockMode(String alias,
LockMode lockMode)
Deprecated.
Set the LockMode to use for specific alias (as defined in the query's FROM clause).
|
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) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setLong(String name,
long val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setMaxResults(int maxResult)
Deprecated.
Set the maximum number of results to retrieve.
|
Query<R> |
setParameter(int position,
Calendar value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Calendar to a positional
parameter. |
Query<R> |
setParameter(int position,
Date value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Date to a positional parameter. |
Query<R> |
setParameter(int position,
Object val)
Deprecated.
Bind a positional query parameter using its inferred Type.
|
Query<R> |
setParameter(int position,
Object val,
Type type)
Deprecated.
Bind a value to a JDBC-style query parameter.
|
<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(Parameter<Calendar> param,
Calendar value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Calendar to a Parameter object. |
Query<R> |
setParameter(Parameter<Date> param,
Date value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Date to a Parameter object. |
<T> Query<R> |
setParameter(Parameter<T> param,
T value)
Deprecated.
Bind the value of a
Parameter object. |
<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> |
setParameter(String name,
Calendar value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Calendar to a named parameter. |
Query<R> |
setParameter(String name,
Date value,
TemporalType temporalType)
Deprecated.
Bind an instance of
java.util.Date to a named parameter. |
Query<R> |
setParameter(String name,
Object val)
Deprecated.
Bind a named query parameter using its inferred Type.
|
Query<R> |
setParameter(String name,
Object val,
Type type)
Deprecated.
Bind a named query parameter using the supplied Type
|
<P> Query<R> |
setParameter(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> |
setParameterList(int position,
Collection values)
Deprecated.
|
Query<R> |
setParameterList(int position,
Collection values,
Type type)
Deprecated.
|
Query<R> |
setParameterList(int position,
Object[] values)
Deprecated.
|
Query<R> |
setParameterList(int position,
Object[] values,
Type type)
Deprecated.
|
<P> Query<R> |
setParameterList(QueryParameter<P> parameter,
Collection<P> values)
Deprecated.
Bind multiple values to a query parameter using its inferred Type.
|
Query<R> |
setParameterList(String name,
Collection values)
Deprecated.
Bind multiple values to a named query parameter.
|
Query<R> |
setParameterList(String name,
Collection values,
Type type)
Deprecated.
Bind multiple values to a named query parameter.
|
Query<R> |
setParameterList(String name,
Object[] values)
Deprecated.
Bind multiple values to a named query parameter.
|
Query<R> |
setParameterList(String name,
Object[] values,
Type type)
Deprecated.
Bind multiple values to a named query parameter.
|
default Query<R> |
setParameters(Object[] values,
Type[] types)
Deprecated.
(since 5.2) Bind values individually
|
Query<R> |
setProperties(Map bean)
Deprecated.
Bind the values of the given Map for each named parameters of the query,
matching key names with parameter names and mapping value types to
Hibernate types using heuristics.
|
Query<R> |
setProperties(Object bean)
Deprecated.
Bind the property values of the given bean to named parameters of the query,
matching property names with parameter names and mapping property types to
Hibernate types using heuristics.
|
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,
Serializable val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setSerializable(String name,
Serializable val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setShort(int position,
short val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setShort(String name,
short val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setString(int position,
String val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setString(String name,
String val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setText(int position,
String val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setText(String name,
String val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setTime(int position,
Date val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setTime(String name,
Date val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
Query<R> |
setTimeout(int timeout)
Deprecated.
Set the query timeout in seconds.
|
default Query<R> |
setTimestamp(int position,
Date val)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
default Query<R> |
setTimestamp(String name,
Date value)
Deprecated.
(since 5.2) use
setParameter(int, Object) or setParameter(int, Object, Type)
instead |
R |
uniqueResult()
Deprecated.
Convenience method to return a single instance that matches
the query, or
null if the query returns no results. |
getResultList, getResultStream, getSingleResult
executeUpdate, getFirstResult, getHints, getLockMode, getMaxResults, getParameter, getParameter, getParameter, getParameter, getParameters, getParameterValue, getParameterValue, getParameterValue, isBound, unwrap
String getQueryString()
RowSelection getQueryOptions()
@Deprecated default Integer getHibernateFirstResult()
Query.getFirstResult()
should be used instead.setFirstResult(int)
or setHibernateFirstResult(int)
.
If the value was not initialized by setFirstResult(int)
or
setHibernateFirstResult(int)
, then null
is returned, resulting
in pagination starting from position 0.
If setHibernateFirstResult(int)
was called with a negative value, then 0
is returned.null
if uninitialized.setFirstResult(int)
,
setHibernateFirstResult(int)
@Deprecated default Query setHibernateFirstResult(int firstRow)
setFirstResult(int)
should be used instead.firstRow
- - the position of the first query resultthis
, for method chaining@Deprecated default Integer getHibernateMaxResults()
Query.getMaxResults()
should be used instead.setMaxResults(int)
or setHibernateMaxResults(int)
.
If the value was not initialized by setMaxResults(int)
or
setHibernateMaxResults(int)
, then null
is returned
If setHibernateMaxResults(int)
was called with a value less than
or equal to 0, the value is considered to be uninitialized, and null
is returned, resulting in no limit on the number of results.@Deprecated default Query setHibernateMaxResults(int maxResults)
setMaxResults(int)
should be used instead.maxResults
- - the maximum number of query resultsthis
, for method chainingFlushMode getHibernateFlushMode()
getHibernateFlushMode
in interface BasicQueryContract<CommonQueryContract>
FlushMode
default Query<R> setHibernateFlushMode(FlushMode flushMode)
setHibernateFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chaininggetHibernateFlushMode()
@Deprecated Query<R> setFlushMode(FlushMode flushMode)
setHibernateFlushMode(org.hibernate.FlushMode)
insteadsetFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chaininggetHibernateFlushMode()
FlushModeType getFlushMode()
FlushModeType
rather than Hibernate's FlushMode
. For
the former behavior, use Query.getHibernateFlushMode()
instead.getFlushMode
in interface Query
CacheMode getCacheMode()
getCacheMode
in interface BasicQueryContract<CommonQueryContract>
Session.getCacheMode()
,
CacheMode
Query<R> setCacheMode(CacheMode cacheMode)
setCacheMode
in interface BasicQueryContract<CommonQueryContract>
cacheMode
- The new CacheMode to use.this
, for method chaininggetCacheMode()
boolean isCacheable()
SessionFactory
for this to happen. Usually that is
controlled by the hibernate.cache.use_query_cache
configuration setting.isCacheable
in interface BasicQueryContract<CommonQueryContract>
true
if the query results are eligible for caching, false
otherwise.AvailableSettings.USE_QUERY_CACHE
Query<R> setCacheable(boolean cacheable)
setCacheable
in interface BasicQueryContract<CommonQueryContract>
cacheable
- Should the query results be cacheable?this
, for method chainingisCacheable()
String getCacheRegion()
isCacheable()
for more information). null
indicates that the
default region should be used.getCacheRegion
in interface BasicQueryContract<CommonQueryContract>
null
indicates
the default region.Query<R> setCacheRegion(String cacheRegion)
setCacheRegion
in interface BasicQueryContract<CommonQueryContract>
cacheRegion
- the name of a query cache region, or null
to indicate that the default region
should be used.this
, for method chaininggetCacheRegion()
Integer getTimeout()
Statement.setQueryTimeout(int)
. Zero indicates no timeout.getTimeout
in interface BasicQueryContract<CommonQueryContract>
Statement.getQueryTimeout()
,
Statement.setQueryTimeout(int)
Query<R> setTimeout(int timeout)
setTimeout
in interface BasicQueryContract<CommonQueryContract>
timeout
- the timeout in secondsthis
, for method chaininggetTimeout()
Integer getFetchSize()
Statement.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.getFetchSize
in interface BasicQueryContract<CommonQueryContract>
Statement.getFetchSize()
,
Statement.setFetchSize(int)
Query<R> setFetchSize(int fetchSize)
setFetchSize
in interface BasicQueryContract<CommonQueryContract>
fetchSize
- the fetch size hintthis
, for method chaininggetFetchSize()
boolean isReadOnly()
isReadOnly
in interface BasicQueryContract<CommonQueryContract>
true
if the entities and proxies loaded by the query will be put
in read-only mode; false
otherwise (they will be modifiable)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.
Query<R> setReadOnly(boolean readOnly)
setReadOnly
in interface BasicQueryContract<CommonQueryContract>
readOnly
- true
indicates that entities and proxies loaded by the query
are to be put in read-only mode; false
indicates that entities and proxies
loaded by the query will be put in modifiable modethis
, for method chainingTo 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.
@Deprecated Type[] getReturnTypes()
getReturnTypes
in interface BasicQueryContract<CommonQueryContract>
LockOptions getLockOptions()
LockOptions
Query<R> setLockOptions(LockOptions lockOptions)
setLockMode(String, LockMode)
.lockOptions
- The lock options to apply to the query.this
, for method chaininggetLockOptions()
Query<R> setLockMode(String alias, LockMode lockMode)
LockOptions
.
The effect of these alias-specific LockModes is somewhat dependent on the driver/database in use. Generally
speaking, for maximum portability, this method should only be used to mark that the rows corresponding to
the given alias should be included in pessimistic locking (LockMode.PESSIMISTIC_WRITE
).alias
- a query alias, or "this"
for a collection filterlockMode
- The lock mode to apply.this
, for method chaininggetLockOptions()
String getComment()
hibernate.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.Query<R> setComment(String comment)
comment
- The human-readable commentthis
, for method chaininggetComment()
Query<R> addQueryHint(String hint)
QueryHint
, which is specific
to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the
vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will
determine concatenation and placement.hint
- The database specific query hint to add.Iterator<R> iterate()
ScrollableResults scroll()
You should call ScrollableResults.close()
after processing the ScrollableResults
so that the underlying resources are deallocated right away.
ScrollableResults
ScrollableResults scroll(ScrollMode scrollMode)
You should call ScrollableResults.close()
after processing the ScrollableResults
so that the underlying resources are deallocated right away.
scrollMode
- The scroll modeScrollableResults
,
ScrollMode
List<R> list()
R uniqueResult()
null
if the query returns no results.NonUniqueResultException
- if there is more than one matching resultParameterMetadata getParameterMetadata()
@Deprecated String[] getNamedParameters()
ParameterMetadata.getNamedParameterNames()
<T> Query<R> setParameter(QueryParameter<T> parameter, T val)
setParameter(QueryParameter, Object, Type)
should be used insteadparameter
- The query parameter mementoval
- the possibly-null parameter valuethis
, for method chaining<T> Query<R> setParameter(Parameter<T> param, T value)
TypedQuery
Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
param
- parameter objectvalue
- parameter valueQuery<R> setParameter(String name, Object val)
setParameter(String, Object, Type)
should be used insteadsetParameter
in interface Query
setParameter
in interface TypedQuery<R>
name
- the parameter nameval
- the (possibly-null) parameter valuethis
, for method chainingQuery<R> setParameter(int position, Object val)
setParameter(int, Object, Type)
should be used insteadsetParameter
in interface Query
setParameter
in interface TypedQuery<R>
position
- the position of the parameter in the query
string, numbered from 0.val
- the possibly-null parameter valuethis
, for method chaining<P> Query<R> setParameter(QueryParameter<P> parameter, P val, Type type)
parameter
- The query parameter mementoval
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingQuery<R> setParameter(String name, Object val, Type type)
name
- the name of the parameterval
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingQuery<R> setParameter(int position, Object val, Type type)
position
- the position of the parameter in the query
string, numbered from 0.val
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chaining<P> Query<R> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
parameter
- The query parameter mementoval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chaining<P> Query<R> setParameter(String name, P val, TemporalType temporalType)
name
- the parameter nameval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chaining<P> Query<R> setParameter(int position, P val, TemporalType temporalType)
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/timethis
, for method chaining<P> Query<R> setParameterList(QueryParameter<P> parameter, Collection<P> values)
parameter
- the parameter mementovalues
- a collection of values to listthis
, for method chainingQuery<R> setParameterList(String name, Collection values)
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingQuery<R> setParameterList(int position, Collection values)
Query<R> setParameterList(String name, Collection values, Type type)
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingQuery<R> setParameterList(int position, Collection values, Type type)
Query<R> setParameterList(String name, Object[] values, Type type)
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingQuery<R> setParameterList(String name, Object[] values)
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingQuery<R> setProperties(Object bean)
bean
- any JavaBean or POJOthis
, for method chainingQuery<R> setProperties(Map bean)
bean
- a java.util.Mapthis
, for method chainingQuery<R> setMaxResults(int maxResult)
TypedQuery
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<R>
maxResult
- maximum number of results to retrieveQuery<R> setFirstResult(int startPosition)
TypedQuery
setFirstResult
in interface Query
setFirstResult
in interface TypedQuery<R>
startPosition
- position of the first result,
numbered from 0Query<R> setHint(String hintName, Object value)
TypedQuery
setHint
in interface Query
setHint
in interface TypedQuery<R>
hintName
- name of property or hintvalue
- value for the property or hintQuery<R> setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typeQuery<R> setParameter(Parameter<Date> param, Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typeQuery<R> setParameter(String name, Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
name
- parameter namevalue
- parameter valuetemporalType
- temporal typeQuery<R> setParameter(String name, Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
name
- parameter namevalue
- parameter valuetemporalType
- temporal typeQuery<R> setParameter(int position, Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a positional
parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
position
- positionvalue
- parameter valuetemporalType
- temporal typeQuery<R> setParameter(int position, Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a positional parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<R>
position
- positionvalue
- parameter valuetemporalType
- temporal typeQuery<R> setFlushMode(FlushModeType flushMode)
TypedQuery
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<R>
flushMode
- flush modeQuery<R> setLockMode(LockModeType lockMode)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<R>
lockMode
- lock mode@Deprecated default Query<R> setString(int position, String val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setCharacter(int position, char val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBoolean(int position, boolean val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setByte(int position, byte val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setShort(int position, short val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setInteger(int position, int val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setLong(int position, long val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setFloat(int position, float val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setDouble(int position, double val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBinary(int position, byte[] val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setText(int position, String val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setSerializable(int position, Serializable val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setLocale(int position, Locale val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBigDecimal(int position, BigDecimal val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBigInteger(int position, BigInteger val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setDate(int position, Date val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setTime(int position, Date val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setTimestamp(int position, Date val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setCalendar(int position, Calendar val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setCalendarDate(int position, Calendar val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadposition
- The parameter positionval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setString(String name, String val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setCharacter(String name, char val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBoolean(String name, boolean val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setByte(String name, byte val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setShort(String name, short val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setInteger(String name, int val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setLong(String name, long val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setFloat(String name, float val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setDouble(String name, double val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBinary(String name, byte[] val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setText(String name, String val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setSerializable(String name, Serializable val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setLocale(String name, Locale val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBigDecimal(String name, BigDecimal val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setBigInteger(String name, BigInteger val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter nameval
- The bind valuethis
, for method chaining@Deprecated default Query<R> setDate(String name, Date val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The name of the parameterval
- The val objectthis
, for method chaining@Deprecated default Query<R> setTime(String name, Date val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The name of the parameterval
- The val objectthis
, for method chaining@Deprecated default Query<R> setTimestamp(String name, Date value)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The name of the parametervalue
- The value objectthis
, for method chaining@Deprecated default Query<R> setCalendar(String name, Calendar value)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter namevalue
- The bind valuethis
, for method chaining@Deprecated default Query<R> setCalendarDate(String name, Calendar value)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadname
- The parameter namevalue
- The bind valuethis
, for method chaining@Deprecated Query<R> setEntity(int position, Object val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadsetParameter(int, Object)
for null values.position
- the position of the parameter in the query
string, numbered from 0.val
- a non-null instance of a persistent classthis
, for method chaining@Deprecated Query<R> setEntity(String name, Object val)
setParameter(int, Object)
or setParameter(int, Object, Type)
insteadsetParameter(String, Object)
for null values.name
- the name of the parameterval
- a non-null instance of a persistent classthis
, for method chaining@Deprecated Type determineProperBooleanType(int position, Object value, Type defaultType)
@Deprecated Type determineProperBooleanType(String name, Object value, Type defaultType)
@Deprecated Query<R> setResultTransformer(ResultTransformer transformer)
transformer
- The transformer to apply@Deprecated String[] getReturnAliases()
Tuple
if you need access to "result variables".@Deprecated default Query<R> setParameters(Object[] values, Type[] types)
types
- The typesvalues
- The valuesthis
, for method chainingCopyright © 2019 JBoss by Red Hat. All rights reserved.