Top Description Methods
org.hibernate

public Interface Query<R>

extends TypedQuery<R>, CommonQueryContract
Known Direct Subinterfaces
org.hibernate.SQLQuery, org.hibernate.query.Query
Annotations
@Deprecated
@SuppressWarnings:UnusedDeclaration
Imports
java.io.Serializable, java.math.BigDecimal, .BigInteger, java.util.Calendar, .Collection, .Date, .Iterator, .List, .Locale, .Map, javax.persistence.FlushModeType, .LockModeType, .Parameter, .TemporalType, .TypedQuery, org.hibernate.engine.spi.RowSelection, org.hibernate.query.CommonQueryContract, .ParameterMetadata, .QueryParameter, org.hibernate.transform.ResultTransformer, org.hibernate.type.BigDecimalType, .BigIntegerType, .BinaryType, .BooleanType, .ByteType, .CharacterType, .DateType, .DoubleType, .FloatType, .IntegerType, .LocaleType, .LongType, .ShortType, .StringType, .TextType, .TimeType, .TimestampType, .Type

Deprecated

(since 5.2) use org.hibernate.query.Query instead

Represents an HQL/JPQL query or a compiled Criteria query
Authors
Gavin King, Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public Query<R>
addQueryHint(String
The database specific query hint to add.
hint
)

Deprecated as a consequence of Query being deprecated.
Add a DB query hint to the SQL.
public Type
determineProperBooleanType(int position, Object value, Type defaultType)

Deprecated added only to allow default method definition for deprecated methods here.
public Type
determineProperBooleanType(String name, Object value, Type defaultType)

Deprecated added only to allow default method definition for deprecated methods here.
public CacheMode

Returns:

The query CacheMode.
getCacheMode
()

Redeclares org.hibernate.BasicQueryContract.getCacheMode.

Obtain the CacheMode in effect for this query.
public String

Returns:

The specified cache region name into which query results should be placed; null indicates the default region.
getCacheRegion
()

Redeclares org.hibernate.BasicQueryContract.getCacheRegion.

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).
public String

Returns:

The comment.
getComment
()

Obtain the comment currently associated with this query.

public Integer

Returns:

The timeout in seconds
getFetchSize
()

Redeclares org.hibernate.BasicQueryContract.getFetchSize.

Obtain the JDBC fetch size hint in effect for this query.
public FlushModeType

Returns:

The FlushModeType in effect for this query.
getFlushMode
()

Redeclares javax.persistence.Query.getFlushMode.

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.
public default Integer

Returns:

the position of the first query result, or null if uninitialized.
getHibernateFirstResult
()

Deprecated getFirstResult() should be used instead.
The position of the first query result to be retrieved, previously set by setFirstResult(int) or setHibernateFirstResult(int).
public FlushMode

Returns:

The query FlushMode.
getHibernateFlushMode
()

Redeclares org.hibernate.BasicQueryContract.getHibernateFlushMode.

Obtain the FlushMode in effect for this query.
public default Integer

Returns:

the maximum number of query results, or null if uninitialized.
getHibernateMaxResults
()

Deprecated getMaxResults() should be used instead.
The maximum number of query results to be retrieved, previously set by setMaxResults(int) or setHibernateMaxResults(int).
public LockOptions

Returns:

The LockOptions
getLockOptions
()

Obtains the LockOptions in effect for this query.

public String[]

Returns:

the parameter names, in no particular order
getNamedParameters
()

Deprecated (since 5.2) use ParameterMetadata#getNamedParameterNames()
Return the names of all named parameters of the query.
public ParameterMetadata

Returns:

information about query parameters.
getParameterMetadata
()

Access to information about query parameters.

public RowSelection

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.
getQueryOptions
()

"QueryOptions" is a better name, I think, than "RowSelection" -> 6.0

public String

Returns:

the query string
getQueryString
()

Get the query string.

public String[]
getReturnAliases()

Deprecated (since 5.2) use javax.persistence.Tuple if you need access to "result variables".
public Type[]

Returns:

an array of types
getReturnTypes
()

Redeclares org.hibernate.BasicQueryContract.getReturnTypes.

Deprecated (since 5.2) with no replacement; to be removed in 6.0
Return the Hibernate types of the query results.
public Integer

Returns:

The timeout in seconds
getTimeout
()

Redeclares org.hibernate.BasicQueryContract.getTimeout.

Obtain the query timeout in seconds.
public boolean

Returns:

true if the query results are eligible for caching, false otherwise.
isCacheable
()

Redeclares org.hibernate.BasicQueryContract.isCacheable.

Are the results of this query eligible for second level query caching?
public boolean

Returns:

true if the entities and proxies loaded by the query will be put in read-only mode; false otherwise (they will be modifiable)
isReadOnly
()

Redeclares org.hibernate.BasicQueryContract.isReadOnly.

Should entities and proxies loaded by this Query be put in read-only mode?
public Iterator<R>

Returns:

the result iterator
iterate
()

Return the query results as an Iterator.

public List<R>

Returns:

the result list
list
()

Return the query results as a List.

public ScrollableResults

Returns:

the result iterator
scroll
()

Return the query results as ScrollableResults.

public ScrollableResults

Returns:

the result iterator
scroll
(ScrollMode
The scroll mode
scrollMode
)

Return the query results as ScrollableResults.

public default Query<R>

Returns:

this, for method chaining
setBigDecimal
(int
The parameter position
position
,
BigDecimal
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional BigDecimal-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBigDecimal
(String
The parameter name
name
,
BigDecimal
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named BigDecimal-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBigInteger
(int
The parameter position
position
,
BigInteger
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional BigDecimal-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBigInteger
(String
The parameter name
name
,
BigInteger
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named BigInteger-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBinary
(int
The parameter position
position
,
byte[]
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional binary-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBinary
(String
The parameter name
name
,
byte[]
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named binary-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBoolean
(int
The parameter position
position
,
boolean
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional boolean-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setBoolean
(String
The parameter name
name
,
boolean
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named boolean-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setByte
(int
The parameter position
position
,
byte
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional byte-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setByte
(String
The parameter name
name
,
byte
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named byte-valued parameter.
public Query<R>

Returns:

this, for method chaining
setCacheable
(boolean
Should the query results be cacheable?
cacheable
)

Redeclares org.hibernate.BasicQueryContract.setCacheable.

Deprecated as a consequence of Query being deprecated.
Enable/disable second level query (result) caching for this query.
public Query<R>

Returns:

this, for method chaining
setCacheMode
(CacheMode
The new CacheMode to use.
cacheMode
)

Redeclares org.hibernate.BasicQueryContract.setCacheMode.

Deprecated as a consequence of Query being deprecated.
(Re)set the current CacheMode in effect for this query.
public Query<R>

Returns:

this, for method chaining
setCacheRegion
(String
the name of a query cache region, or null to indicate that the default region should be used.
cacheRegion
)

Redeclares org.hibernate.BasicQueryContract.setCacheRegion.

Deprecated as a consequence of Query being deprecated.
Set the name of the cache region where query results should be cached (if cached at all).
public default Query<R>

Returns:

this, for method chaining
setCalendar
(int
The parameter position
position
,
Calendar
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Calendar-valued parameter using the full Timestamp portion.
public default Query<R>

Returns:

this, for method chaining
setCalendar
(String
The parameter name
name
,
Calendar
The bind value
value
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named Calendar-valued parameter using the full Timestamp.
public default Query<R>

Returns:

this, for method chaining
setCalendarDate
(int
The parameter position
position
,
Calendar
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Calendar-valued parameter using just the Date portion.
public default Query<R>

Returns:

this, for method chaining
setCalendarDate
(String
The parameter name
name
,
Calendar
The bind value
value
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named Calendar-valued parameter using just the Date portion.
public default Query<R>

Returns:

this, for method chaining
setCharacter
(int
The parameter position
position
,
char
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional char-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setCharacter
(String
The parameter name
name
,
char
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named char-valued parameter.
public Query<R>

Returns:

this, for method chaining
setComment
(String
The human-readable comment
comment
)

Deprecated as a consequence of Query being deprecated.
Set the comment for this query.
public default Query<R>

Returns:

this, for method chaining
setDate
(int
The parameter position
position
,
Date
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Date-valued parameter using just the Date portion.
public default Query<R>

Returns:

this, for method chaining
setDate
(String
The name of the parameter
name
,
Date
The val object
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind the val (time is truncated) of a given Date object to a named query parameter.
public default Query<R>

Returns:

this, for method chaining
setDouble
(int
The parameter position
position
,
double
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional double-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setDouble
(String
The parameter name
name
,
double
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named double-valued parameter.
public Query<R>

Returns:

this, for method chaining
setEntity
(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
a non-null instance of a persistent class
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind an instance of a mapped persistent class to a JDBC-style query parameter.
public Query<R>

Returns:

this, for method chaining
setEntity
(String
the name of the parameter
name
,
Object
a non-null instance of a persistent class
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind an instance of a mapped persistent class to a named query parameter.
public Query<R>

Returns:

this, for method chaining
setFetchSize
(int
the fetch size hint
fetchSize
)

Redeclares org.hibernate.BasicQueryContract.setFetchSize.

Deprecated as a consequence of Query being deprecated.
Sets a JDBC fetch size hint for the query.
public Query<R>
setFirstResult(int
position of the first result, numbered from 0
startPosition
)

Redeclares javax.persistence.TypedQuery.setFirstResult.

Deprecated as a consequence of Query being deprecated.
Set the position of the first result to retrieve.
public default Query<R>

Returns:

this, for method chaining
setFloat
(int
The parameter position
position
,
float
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional float-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setFloat
(String
The parameter name
name
,
float
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named float-valued parameter.
public Query<R>

Returns:

this, for method chaining
setFlushMode
(FlushMode
The new FlushMode to use.
flushMode
)

Redeclares as abstract: org.hibernate.BasicQueryContract.setFlushMode.

Deprecated (since 5.2) use setHibernateFlushMode instead
(Re)set the current FlushMode in effect for this query.
public Query<R>
setFlushMode(FlushModeType
flush mode
flushMode
)

Redeclares javax.persistence.TypedQuery.setFlushMode.

Deprecated as a consequence of Query being deprecated.
Set the flush mode type to be used for the query execution.
public default Query<R>

Returns:

this, for method chaining
setHibernateFirstResult
(int
- the position of the first query result
firstRow
)

Deprecated setFirstResult(int) should be used instead.
Set the position of the first query result to be retrieved.
public default Query<R>

Returns:

this, for method chaining
setHibernateFlushMode
(FlushMode
The new FlushMode to use.
flushMode
)

Implements org.hibernate.BasicQueryContract.setHibernateFlushMode.

Deprecated as a consequence of Query being deprecated.
(Re)set the current FlushMode in effect for this query.
public default Query<R>

Returns:

this, for method chaining
setHibernateMaxResults
(int
- the maximum number of query results
maxResults
)

Deprecated setMaxResults(int) should be used instead.
Set the maximum number of query results to be retrieved.
public Query<R>
setHint(String
name of property or hint
hintName
,
Object
value for the property or hint
value
)

Redeclares javax.persistence.TypedQuery.setHint.

Deprecated as a consequence of Query being deprecated.
Set a query property or hint.
public default Query<R>

Returns:

this, for method chaining
setInteger
(int
The parameter position
position
,
int
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional int-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setInteger
(String
The parameter name
name
,
int
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named int-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setLocale
(int
The parameter position
position
,
Locale
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Locale-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setLocale
(String
The parameter name
name
,
Locale
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named Locale-valued parameter.
public Query<R>

Returns:

this, for method chaining
setLockMode
(String
a query alias, or "this" for a collection filter
alias
,
LockMode
The lock mode to apply.
lockMode
)

Deprecated as a consequence of Query being deprecated.
Set the LockMode to use for specific alias (as defined in the query's FROM clause).
public Query<R>
setLockMode(LockModeType
lock mode
lockMode
)

Redeclares javax.persistence.TypedQuery.setLockMode.

Deprecated as a consequence of Query being deprecated.
Set the lock mode type to be used for the query execution.
public Query<R>

Returns:

this, for method chaining
setLockOptions
(LockOptions
The lock options to apply to the query.
lockOptions
)

Deprecated as a consequence of Query being deprecated.
Set the lock options for the query.
public default Query<R>

Returns:

this, for method chaining
setLong
(int
The parameter position
position
,
long
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional long-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setLong
(String
The parameter name
name
,
long
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named long-valued parameter.
public Query<R>
setMaxResults(int
maximum number of results to retrieve
maxResult
)

Redeclares javax.persistence.TypedQuery.setMaxResults.

Deprecated as a consequence of Query being deprecated.
Set the maximum number of results to retrieve.
public <T> Query<R>

Returns:

this, for method chaining
setParameter
(QueryParameter<T>
The query parameter memento
parameter
,
T
the possibly-null parameter value
val
)

Deprecated as a consequence of Query being deprecated.
Bind a query parameter using its inferred Type.
public <T> Query<R>
setParameter(Parameter<T>
parameter object
param
,
T
parameter value
value
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind the value of a Parameter object.
public Query<R>

Returns:

this, for method chaining
setParameter
(String
the parameter name
name
,
Object
the (possibly-null) parameter value
val
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a named query parameter using its inferred Type.
public Query<R>

Returns:

this, for method chaining
setParameter
(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
the possibly-null parameter value
val
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a positional query parameter using its inferred Type.
public <P> Query<R>

Returns:

this, for method chaining
setParameter
(QueryParameter<P>
The query parameter memento
parameter
,
P
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Deprecated as a consequence of Query being deprecated.
Bind a query parameter using the supplied Type
public Query<R>

Returns:

this, for method chaining
setParameter
(String
the name of the parameter
name
,
Object
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Deprecated as a consequence of Query being deprecated.
Bind a named query parameter using the supplied Type
public Query<R>

Returns:

this, for method chaining
setParameter
(int
the position of the parameter in the query string, numbered from 0.
position
,
Object
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Deprecated as a consequence of Query being deprecated.
Bind a value to a JDBC-style query parameter.
public <P> Query<R>

Returns:

this, for method chaining
setParameter
(QueryParameter<P>
The query parameter memento
parameter
,
P
the possibly-null parameter value
val
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Deprecated as a consequence of Query being deprecated.
Bind a query parameter as some form of date/time using the indicated temporal-type.
public <P> Query<R>

Returns:

this, for method chaining
setParameter
(String
the parameter name
name
,
P
the possibly-null parameter value
val
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Deprecated as a consequence of Query being deprecated.
Bind a named query parameter as some form of date/time using the indicated temporal-type.
public <P> Query<R>

Returns:

this, for method chaining
setParameter
(int
the position of the parameter in the query string, numbered from 0.
position
,
P
the possibly-null parameter value
val
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Deprecated as a consequence of Query being deprecated.
Bind a positional query parameter as some form of date/time using the indicated temporal-type.
public Query<R>
setParameter(Parameter<Calendar>
parameter object
param
,
Calendar
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Calendar to a Parameter object.
public Query<R>
setParameter(Parameter<Date>
parameter object
param
,
Date
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Date to a Parameter object.
public Query<R>
setParameter(String
parameter name
name
,
Calendar
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Calendar to a named parameter.
public Query<R>
setParameter(String
parameter name
name
,
Date
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Date to a named parameter.
public Query<R>
setParameter(int
position
position
,
Calendar
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Calendar to a positional parameter.
public Query<R>
setParameter(int
position
position
,
Date
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Date to a positional parameter.
public <P> Query<R>

Returns:

this, for method chaining
setParameterList
(QueryParameter<P>
the parameter memento
parameter
,
Collection<P>
a collection of values to list
values
)

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a query parameter using its inferred Type.
public Query<R>

Returns:

this, for method chaining
setParameterList
(String
the name of the parameter
name
,
Collection<E>
a collection of values to list
values
)

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(int position, Collection<E> values)

Deprecated as a consequence of Query being deprecated.
public Query<R>

Returns:

this, for method chaining
setParameterList
(String
the name of the parameter
name
,
Collection<E>
a collection of values to list
values
,
Type
the Hibernate type of the values
type
)

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(int position, Collection<E> values, Type type)

Deprecated as a consequence of Query being deprecated.
public Query<R>

Returns:

this, for method chaining
setParameterList
(String
the name of the parameter
name
,
Object[]
a collection of values to list
values
,
Type
the Hibernate type of the values
type
)

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(int position, Object[] values, Type type)

Deprecated as a consequence of Query being deprecated.
public Query<R>

Returns:

this, for method chaining
setParameterList
(String
the name of the parameter
name
,
Object[]
a collection of values to list
values
)

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(int position, Object[] values)

Deprecated as a consequence of Query being deprecated.
public default Query<R>

Returns:

this, for method chaining
setParameters
(Object[]
The values
values
,
Type[]
The types
types
)

Deprecated (since 5.2) Bind values individually
Bind values and types to positional parameters.
public Query<R>

Returns:

this, for method chaining
setProperties
(Object
any JavaBean or POJO
bean
)

Deprecated as a consequence of Query being 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.
public Query<R>

Returns:

this, for method chaining
setProperties
(Map<K, V>
a java.util.Map
bean
)

Deprecated as a consequence of Query being 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.
public Query<R>

Returns:

this, for method chaining
setReadOnly
(boolean
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
readOnly
)

Redeclares org.hibernate.BasicQueryContract.setReadOnly.

Deprecated as a consequence of Query being deprecated.
Set the read-only/modifiable mode for entities and proxies loaded by this Query.
public Query<R>

Returns:

this (for method chaining)
setResultTransformer
(ResultTransformer
The transformer to apply
transformer
)

Deprecated (since 5.2)
Set a strategy for handling the query results.
public default Query<R>

Returns:

this, for method chaining
setSerializable
(int
The parameter position
position
,
Serializable
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional binary-valued parameter using serialization.
public default Query<R>

Returns:

this, for method chaining
setSerializable
(String
The parameter name
name
,
Serializable
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named binary-valued parameter using serialization.
public default Query<R>

Returns:

this, for method chaining
setShort
(int
The parameter position
position
,
short
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional short-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setShort
(String
The parameter name
name
,
short
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named short-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setString
(int
The parameter position
position
,
String
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional String-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setString
(String
The parameter name
name
,
String
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named String-valued parameter.
public default Query<R>

Returns:

this, for method chaining
setText
(int
The parameter position
position
,
String
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional String-valued parameter using streaming.
public default Query<R>

Returns:

this, for method chaining
setText
(String
The parameter name
name
,
String
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a named String-valued parameter using streaming.
public default Query<R>

Returns:

this, for method chaining
setTime
(int
The parameter position
position
,
Date
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Date-valued parameter using just the Time portion.
public default Query<R>

Returns:

this, for method chaining
setTime
(String
The name of the parameter
name
,
Date
The val object
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind the time (val is truncated) of a given Date object to a named query parameter.
public Query<R>

Returns:

this, for method chaining
setTimeout
(int
the timeout in seconds
timeout
)

Redeclares org.hibernate.BasicQueryContract.setTimeout.

Deprecated as a consequence of Query being deprecated.
Set the query timeout in seconds.
public default Query<R>

Returns:

this, for method chaining
setTimestamp
(int
The parameter position
position
,
Date
The bind value
val
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind a positional Date-valued parameter using the full Timestamp.
public default Query<R>

Returns:

this, for method chaining
setTimestamp
(String
The name of the parameter
name
,
Date
The value object
value
)

Deprecated (since 5.2) use setParameter(int, Object) or setParameter(int, Object, Type) instead
Bind the value and the time of a given Date object to a named query parameter.
public R

Returns:

the single result or null
uniqueResult
()

Convenience method to return a single instance that matches the query, or null if the query returns no results.

Inherited from javax.persistence.TypedQuery:
getResultListgetResultStreamgetSingleResult