Top Description Methods
org.hibernate.query

public Interface Query<R>

extends TypedQuery<R>, Query<R>, CommonQueryContract
Known Direct Subinterfaces
org.hibernate.query.spi.QueryImplementor, org.hibernate.query.NativeQuery
Known Direct Implementers
org.hibernate.query.internal.QueryImpl
Annotations
@SuppressWarnings:UnusedDeclaratiqon
Imports
java.io.Serializable, java.math.BigDecimal, .BigInteger, java.time.Instant, .LocalDateTime, .OffsetDateTime, .ZonedDateTime, java.util.Calendar, .Collection, .Date, .List, .Locale, .Map, .Optional, java.util.stream.Stream, javax.persistence.FlushModeType, .LockModeType, .Parameter, .TemporalType, .TypedQuery, org.hibernate.CacheMode, .FlushMode, .LockMode, .LockOptions, .ScrollMode, .ScrollableResults, org.hibernate.graph.GraphSemantic, .RootGraph, 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

as a consequence of Query and CommonQueryContract being deprecated. See corresponding docs for further information.

Represents an HQL/JPQL query or a compiled Criteria query. Also acts as the Hibernate extension to the JPA Query/TypedQuery contract

Note

org.hibernate.Query is deprecated, and slated for removal in 6.0. For the time being we leave all methods defined on org.hibernate.Query rather than here because it was previously the public API so we want to leave that unchanged in 5.x. For 6.0 we will move those methods here and then delete that class.

Authors
Steve Ebersole, Gavin King

Method Summary

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

Redeclares org.hibernate.Query.addQueryHint.

Deprecated as a consequence of Query being deprecated.
Add a DB query hint to the SQL.
public default Query<R>
applyFetchGraph(RootGraph<J> graph)

Deprecated as a consequence of Query being deprecated.
Apply the given graph using fetch semantics
public Query<R>

Returns:

this - for method chaining
applyGraph
(RootGraph<J>
The graph the apply.
graph
,
GraphSemantic
The semantic to use when applying the graph
semantic
)

Deprecated as a consequence of Query being deprecated.
Apply the given graph using the given semantic
public default Query<R>
applyLoadGraph(RootGraph<J> graph)

Deprecated as a consequence of Query being deprecated.
Apply the given graph using load semantics
public CacheMode
getCacheMode()

Redeclares org.hibernate.Query.getCacheMode, org.hibernate.BasicQueryContract.getCacheMode.

Obtain the CacheMode in effect for this query.
public String
getCacheRegion()

Redeclares org.hibernate.Query.getCacheRegion, 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
getComment()

Redeclares org.hibernate.Query.getComment.

Obtain the comment currently associated with this query.
public Integer
getFetchSize()

Redeclares org.hibernate.Query.getFetchSize, org.hibernate.BasicQueryContract.getFetchSize.

Obtain the JDBC fetch size hint in effect for this query.
public FlushMode
public LockOptions
getLockOptions()

Redeclares org.hibernate.Query.getLockOptions.

Obtains the LockOptions in effect for this query.
public ParameterMetadata
getParameterMetadata()

Redeclares org.hibernate.Query.getParameterMetadata.

Access to information about query parameters.
public QueryProducer
getProducer()

Get the QueryProducer this Query originates from.

public String
getQueryString()

Redeclares org.hibernate.Query.getQueryString.

Get the query string.
public default List<R>
getResultList()

Implements javax.persistence.TypedQuery.getResultList.

Execute a SELECT query and return the query results as a typed List.
public default Stream<R>

Returns:

The results Stream
getResultStream
()

Overrides default javax.persistence.TypedQuery.getResultStream.

JPA 2.2 defines the getResultStream method so to get a Stream from the JDBC java.sql.ResultSet.
public default R
getSingleResult()

Implements javax.persistence.TypedQuery.getSingleResult.

Execute a SELECT query that returns a single result.
public List<R>
list()

Redeclares org.hibernate.Query.list.

Return the query results as a List.
public ScrollableResults
scroll()

Redeclares org.hibernate.Query.scroll.

Return the query results as ScrollableResults.
public ScrollableResults
scroll(ScrollMode
The scroll mode
scrollMode
)

Redeclares org.hibernate.Query.scroll.

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
)

Overrides default org.hibernate.Query.setBigDecimal.

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
)

Overrides default org.hibernate.Query.setBigDecimal.

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
)

Overrides default org.hibernate.Query.setBigInteger.

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
)

Overrides default org.hibernate.Query.setBigInteger.

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
)

Overrides default org.hibernate.Query.setBinary.

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
)

Overrides default org.hibernate.Query.setBinary.

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
)

Overrides default org.hibernate.Query.setBoolean.

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
)

Overrides default org.hibernate.Query.setBoolean.

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
)

Overrides default org.hibernate.Query.setByte.

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
)

Overrides default org.hibernate.Query.setByte.

Bind a named byte-valued parameter.
public Query<R>
setCacheable(boolean
Should the query results be cacheable?
cacheable
)

Redeclares org.hibernate.Query.setCacheable, 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>
setCacheMode(CacheMode
The new CacheMode to use.
cacheMode
)

Redeclares org.hibernate.Query.setCacheMode, 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>
setCacheRegion(String
the name of a query cache region, or null to indicate that the default region should be used.
cacheRegion
)

Redeclares org.hibernate.Query.setCacheRegion, 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
)

Overrides default org.hibernate.Query.setCalendar.

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
)

Overrides default org.hibernate.Query.setCalendar.

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
)

Overrides default org.hibernate.Query.setCalendarDate.

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
)

Overrides default org.hibernate.Query.setCalendarDate.

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
)

Overrides default org.hibernate.Query.setCharacter.

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
)

Overrides default org.hibernate.Query.setCharacter.

Bind a named char-valued parameter.
public Query<R>
setComment(String
The human-readable comment
comment
)

Redeclares org.hibernate.Query.setComment.

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
)

Overrides default org.hibernate.Query.setDate.

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
)

Overrides default org.hibernate.Query.setDate.

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
)

Overrides default org.hibernate.Query.setDouble.

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
)

Overrides default org.hibernate.Query.setDouble.

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
)

Redeclares org.hibernate.Query.setEntity.

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
)

Redeclares org.hibernate.Query.setEntity.

Bind an instance of a mapped persistent class to a named query parameter.
public Query<R>
setFetchSize(int
the fetch size hint
fetchSize
)

Redeclares org.hibernate.Query.setFetchSize, 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, org.hibernate.Query.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
)

Overrides default org.hibernate.Query.setFloat.

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
)

Overrides default org.hibernate.Query.setFloat.

Bind a named float-valued parameter.
public Query<R>
setFlushMode(FlushModeType
flush mode
flushMode
)

Redeclares javax.persistence.TypedQuery.setFlushMode, org.hibernate.Query.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
setFlushMode
(FlushMode
The new FlushMode to use.
flushMode
)

Overrides default org.hibernate.BasicQueryContract.setFlushMode.

Implements org.hibernate.Query.setFlushMode.

Deprecated (since 5.2) use setHibernateFlushMode instead
(Re)set the current FlushMode in effect for this query.
public Query<R>
setHibernateFlushMode(FlushMode
The new FlushMode to use.
flushMode
)

Redeclares org.hibernate.BasicQueryContract.setHibernateFlushMode.

Redeclares as abstract: org.hibernate.Query.setHibernateFlushMode.

Deprecated as a consequence of Query being deprecated.
(Re)set the current FlushMode in effect for this query.
public Query<R>
setHint(String
name of property or hint
hintName
,
Object
value for the property or hint
value
)

Redeclares javax.persistence.TypedQuery.setHint, org.hibernate.Query.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
)

Overrides default org.hibernate.Query.setInteger.

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
)

Overrides default org.hibernate.Query.setInteger.

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
)

Overrides default org.hibernate.Query.setLocale.

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
)

Overrides default org.hibernate.Query.setLocale.

Bind a named Locale-valued parameter.
public Query<R>
setLockMode(LockModeType
lock mode
lockMode
)

Redeclares javax.persistence.TypedQuery.setLockMode, org.hibernate.Query.setLockMode.

Deprecated as a consequence of Query being deprecated.
Set the lock mode type to be used for the query execution.
public Query<R>
setLockMode(String
a query alias, or "this" for a collection filter
alias
,
LockMode
The lock mode to apply.
lockMode
)

Redeclares org.hibernate.Query.setLockMode.

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>
setLockOptions(LockOptions
The lock options to apply to the query.
lockOptions
)

Redeclares org.hibernate.Query.setLockOptions.

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
)

Overrides default org.hibernate.Query.setLong.

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
)

Overrides default org.hibernate.Query.setLong.

Bind a named long-valued parameter.
public Query<R>
setMaxResults(int
maximum number of results to retrieve
maxResult
)

Redeclares javax.persistence.TypedQuery.setMaxResults, org.hibernate.Query.setMaxResults.

Deprecated as a consequence of Query being deprecated.
Set the maximum number of results to retrieve.
public Query<R>
setParameter(Parameter<Instant> param, Instant value, TemporalType temporalType)

Deprecated as a consequence of Query being deprecated.
public Query<R>
setParameter(Parameter<LocalDateTime> param, LocalDateTime value, TemporalType temporalType)

Deprecated as a consequence of Query being deprecated.
public Query<R>
setParameter(Parameter<ZonedDateTime> param, ZonedDateTime value, TemporalType temporalType)

Deprecated as a consequence of Query being deprecated.
public Query<R>
setParameter(Parameter<OffsetDateTime> param, OffsetDateTime value, TemporalType temporalType)

Deprecated as a consequence of Query being deprecated.
public Query<R>
setParameter(String
the parameter name
name
,
Instant
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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 Query<R>
setParameter(String
the parameter name
name
,
LocalDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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 Query<R>
setParameter(String
the parameter name
name
,
ZonedDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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 Query<R>
setParameter(String
the parameter name
name
,
OffsetDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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 Query<R>
setParameter(int
the position of the parameter in the query string, numbered from 0.
position
,
Instant
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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(int
the position of the parameter in the query string, numbered from 0.
position
,
LocalDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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(int
the position of the parameter in the query string, numbered from 0.
position
,
ZonedDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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(int
the position of the parameter in the query string, numbered from 0.
position
,
OffsetDateTime
the possibly-null parameter value
value
,
TemporalType
the temporal-type to use in binding the date/time
temporalType
)

Redeclares org.hibernate.Query.setParameter.

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 <T> Query<R>
setParameter(Parameter<T>
parameter object
param
,
T
parameter value
value
)

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.setParameter.

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

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.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, org.hibernate.Query.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
,
Object
parameter value
value
)

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an argument value to a named parameter.
public Query<R>
setParameter(String
the name of the parameter
name
,
Object
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Redeclares org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a named query parameter using the supplied Type
public Query<R>
setParameter(String
parameter name
name
,
Calendar
parameter value
value
,
TemporalType
temporal type
temporalType
)

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.setParameter, org.hibernate.Query.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, org.hibernate.Query.setParameter, org.hibernate.Query.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
,
Object
parameter value
value
)

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.setParameter.

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

Redeclares javax.persistence.TypedQuery.setParameter, org.hibernate.Query.setParameter, org.hibernate.Query.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, org.hibernate.Query.setParameter, org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind an instance of java.util.Date to a positional parameter.
public <T> Query<R>
setParameter(QueryParameter<T>
The query parameter memento
parameter
,
T
the possibly-null parameter value
val
)

Redeclares org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a query parameter using its inferred Type.
public <P> Query<R>
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
)

Redeclares org.hibernate.Query.setParameter.

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 <P> Query<R>
setParameter(QueryParameter<P>
The query parameter memento
parameter
,
P
the possibly-null parameter value
val
,
Type
the Hibernate type
type
)

Redeclares org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a query parameter using the supplied Type
public Query<R>
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
)

Redeclares org.hibernate.Query.setParameter.

Deprecated as a consequence of Query being deprecated.
Bind a value to a JDBC-style query parameter.
public <P> Query<R>
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
)

Redeclares org.hibernate.Query.setParameter.

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>
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
)

Redeclares org.hibernate.Query.setParameter.

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>
setParameterList(QueryParameter<P>
the parameter memento
parameter
,
Collection<P>
a collection of values to list
values
)

Redeclares org.hibernate.Query.setParameterList.

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a query parameter using its inferred Type.
public Query<R>
setParameterList(String
the name of the parameter
name
,
Collection<E>
a collection of values to list
values
)

Redeclares org.hibernate.Query.setParameterList.

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
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
)

Redeclares org.hibernate.Query.setParameterList.

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(String
the name of the parameter
name
,
Object[]
a collection of values to list
values
,
Type
the Hibernate type of the values
type
)

Redeclares org.hibernate.Query.setParameterList.

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public Query<R>
setParameterList(String
the name of the parameter
name
,
Object[]
a collection of values to list
values
)

Redeclares org.hibernate.Query.setParameterList.

Deprecated as a consequence of Query being deprecated.
Bind multiple values to a named query parameter.
public default Query<R>

Returns:

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

Overrides default org.hibernate.Query.setParameters.

Deprecated (since 5.2) Bind values individually
Bind values and types to positional parameters.
public Query<R>
setProperties(Object
any JavaBean or POJO
bean
)

Redeclares org.hibernate.Query.setProperties.

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>
setProperties(Map<K, V>
a java.util.Map
bean
)

Redeclares org.hibernate.Query.setProperties.

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>
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.Query.setReadOnly, 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
)

Redeclares org.hibernate.Query.setResultTransformer.

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
)

Overrides default org.hibernate.Query.setSerializable.

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
)

Overrides default org.hibernate.Query.setSerializable.

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
)

Overrides default org.hibernate.Query.setShort.

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
)

Overrides default org.hibernate.Query.setShort.

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
)

Overrides default org.hibernate.Query.setString.

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
)

Overrides default org.hibernate.Query.setString.

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
)

Overrides default org.hibernate.Query.setText.

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
)

Overrides default org.hibernate.Query.setText.

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
)

Overrides default org.hibernate.Query.setTime.

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
)

Overrides default org.hibernate.Query.setTime.

Bind the time (val is truncated) of a given Date object to a named query parameter.
public Query<R>
setTimeout(int
the timeout in seconds
timeout
)

Redeclares org.hibernate.Query.setTimeout, 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
)

Overrides default org.hibernate.Query.setTimestamp.

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
)

Overrides default org.hibernate.Query.setTimestamp.

Bind the value and the time of a given Date object to a named query parameter.
public Stream<R>

Returns:

The results Stream
stream
()

Retrieve a Stream over the query results.

public R
uniqueResult()

Redeclares org.hibernate.Query.uniqueResult.

Convenience method to return a single instance that matches the query, or null if the query returns no results.
public Optional<R>
Inherited from org.hibernate.Query:
determineProperBooleanTypedetermineProperBooleanTypegetFlushModegetHibernateFirstResultgetHibernateMaxResultsgetNamedParametersgetQueryOptionsgetReturnAliasesgetReturnTypesgetTimeoutisCacheableisReadOnlyiteratesetHibernateFirstResultsetHibernateMaxResultssetParameterListsetParameterListsetParameterListsetParameterList