public class StageQueryImpl<R> extends java.lang.Object implements Stage.Query<R>
Stage.Query
.Constructor and Description |
---|
StageQueryImpl(ReactiveQuery<R> delegate,
StageSessionFactoryImpl factory) |
StageQueryImpl(ReactiveQuery<R> delegate,
java.lang.String[] querySpaces,
StageSessionFactoryImpl factory) |
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.CompletionStage<java.lang.Integer> |
executeUpdate()
Asynchronously execute this delete, update, or insert query,
returning the updated row count.
|
org.hibernate.CacheMode |
getCacheMode()
Obtain the
CacheMode in effect for this query. |
java.lang.String |
getCacheRegion() |
int |
getFirstResult() |
org.hibernate.FlushMode |
getFlushMode()
Obtain the
FlushMode in effect for this query. |
int |
getMaxResults() |
java.util.concurrent.CompletionStage<java.util.List<R>> |
getResultList()
Asynchronously execute this query, returning the query results
as a
List , via a CompletionStage . |
java.util.concurrent.CompletionStage<R> |
getSingleResult()
Asynchronously execute this query, returning a single row that
matches the query, throwing an exception if the query returns
zero rows or more than one matching row.
|
java.util.concurrent.CompletionStage<R> |
getSingleResultOrNull()
Asynchronously execute this query, returning a single row that
matches the query, or
null if the query returns no results,
throwing an exception if the query returns more than one matching
row. |
boolean |
isCacheable() |
boolean |
isReadOnly() |
Stage.Query<R> |
setCacheable(boolean cacheable)
Enable or disable caching of this query result set in the
second-level query cache.
|
Stage.Query<R> |
setCacheMode(org.hibernate.CacheMode cacheMode)
Set the current
CacheMode in effect while this query
is being executed. |
Stage.Query<R> |
setCacheRegion(java.lang.String cacheRegion)
Set the name of the cache region in which to store this
query result set if
caching is enabled . |
Stage.Query<R> |
setComment(java.lang.String comment)
Set the comment for this query.
|
Stage.Query<R> |
setFirstResult(int firstResult)
Set the position of the first result that may be returned by
this query when executed, where the results are numbered from
0.
|
Stage.Query<R> |
setFlushMode(org.hibernate.FlushMode flushMode)
Set the current
FlushMode in effect while this query is
being executed. |
Stage.Query<R> |
setLockMode(org.hibernate.LockMode lockMode)
Set the
LockMode to use for the whole query. |
Stage.Query<R> |
setLockMode(java.lang.String alias,
org.hibernate.LockMode lockMode)
Set the
LockMode to use for specified alias (as defined in
the query's from clause). |
Stage.Query<R> |
setLockOptions(org.hibernate.LockOptions lockOptions) |
Stage.Query<R> |
setMaxResults(int maxResults)
Set the maximum number of results that may be returned by this
query when executed.
|
Stage.Query<R> |
setParameter(int position,
java.lang.Object value)
Set the value of a positional parameter.
|
<T> Stage.Query<R> |
setParameter(javax.persistence.Parameter<T> parameter,
T value)
Set the value of a typed parameter.
|
Stage.Query<R> |
setParameter(java.lang.String name,
java.lang.Object value)
Set the value of a named parameter.
|
Stage.Query<R> |
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies
loaded by this Query.
|
public StageQueryImpl(ReactiveQuery<R> delegate, StageSessionFactoryImpl factory)
public StageQueryImpl(ReactiveQuery<R> delegate, java.lang.String[] querySpaces, StageSessionFactoryImpl factory)
public Stage.Query<R> setParameter(int position, java.lang.Object value)
Stage.Query
?1
, ?2
, etc.setParameter
in interface Stage.Query<R>
public Stage.Query<R> setParameter(java.lang.String name, java.lang.Object value)
Stage.Query
:name
.setParameter
in interface Stage.Query<R>
public <T> Stage.Query<R> setParameter(javax.persistence.Parameter<T> parameter, T value)
Stage.Query
CriteriaBuilder
, which may
itself be obtained by calling
Stage.SessionFactory.getCriteriaBuilder()
.setParameter
in interface Stage.Query<R>
CriteriaBuilder.parameter(Class)
public Stage.Query<R> setMaxResults(int maxResults)
Stage.Query
setMaxResults
in interface Stage.Query<R>
public int getMaxResults()
getMaxResults
in interface Stage.Query<R>
Integer.MAX_VALUE
if not setpublic Stage.Query<R> setFirstResult(int firstResult)
Stage.Query
setFirstResult
in interface Stage.Query<R>
public int getFirstResult()
getFirstResult
in interface Stage.Query<R>
public Stage.Query<R> setReadOnly(boolean readOnly)
Stage.Query
setReadOnly
in interface Stage.Query<R>
Stage.Session.setDefaultReadOnly(boolean)
public boolean isReadOnly()
isReadOnly
in interface Stage.Query<R>
Stage.Session.isDefaultReadOnly()
public Stage.Query<R> setComment(java.lang.String comment)
Stage.Query
setComment
in interface Stage.Query<R>
comment
- The human-readable commentpublic Stage.Query<R> setCacheable(boolean cacheable)
Stage.Query
setCacheable
in interface Stage.Query<R>
cacheable
- true
if this query is cacheablepublic boolean isCacheable()
isCacheable
in interface Stage.Query<R>
true
if this query is cacheableStage.Query.setCacheable(boolean)
public Stage.Query<R> setCacheRegion(java.lang.String cacheRegion)
Stage.Query
caching is enabled
.setCacheRegion
in interface Stage.Query<R>
cacheRegion
- the name of the cache regionpublic java.lang.String getCacheRegion()
getCacheRegion
in interface Stage.Query<R>
Stage.Query.setCacheRegion(String)
public Stage.Query<R> setLockMode(org.hibernate.LockMode lockMode)
Stage.Query
LockMode
to use for the whole query.setLockMode
in interface Stage.Query<R>
public Stage.Query<R> setLockOptions(org.hibernate.LockOptions lockOptions)
public Stage.Query<R> setLockMode(java.lang.String alias, org.hibernate.LockMode lockMode)
Stage.Query
LockMode
to use for specified alias (as defined in
the query's from
clause).setLockMode
in interface Stage.Query<R>
alias
- the from clause aliaslockMode
- the requested LockMode
Query.setLockMode(String,LockMode)
public Stage.Query<R> setCacheMode(org.hibernate.CacheMode cacheMode)
Stage.Query
CacheMode
in effect while this query
is being executed.setCacheMode
in interface Stage.Query<R>
public org.hibernate.CacheMode getCacheMode()
Stage.Query
CacheMode
in effect for this query. By default,
the query inherits the CacheMode
of the Stage.Session
from which is originates.getCacheMode
in interface Stage.Query<R>
Stage.Session.getCacheMode()
public Stage.Query<R> setFlushMode(org.hibernate.FlushMode flushMode)
Stage.Query
FlushMode
in effect while this query is
being executed.setFlushMode
in interface Stage.Query<R>
public org.hibernate.FlushMode getFlushMode()
Stage.Query
FlushMode
in effect for this query. By default,
the query inherits the FlushMode
of the Stage.Session
from which is originates.getFlushMode
in interface Stage.Query<R>
Stage.Session.getFlushMode()
public java.util.concurrent.CompletionStage<java.lang.Integer> executeUpdate()
Stage.Query
executeUpdate
in interface Stage.Query<R>
Query.executeUpdate()
public java.util.concurrent.CompletionStage<R> getSingleResult()
Stage.Query
Object[]
.getSingleResult
in interface Stage.Query<R>
Query.getSingleResult()
public java.util.concurrent.CompletionStage<R> getSingleResultOrNull()
Stage.Query
null
if the query returns no results,
throwing an exception if the query returns more than one matching
row. If the query has multiple results per row, the results are
returned in an instance of Object[]
.getSingleResultOrNull
in interface Stage.Query<R>
null
Stage.Query.getSingleResult()
public java.util.concurrent.CompletionStage<java.util.List<R>> getResultList()
Stage.Query
List
, via a CompletionStage
. If the query
has multiple results per row, the results are returned in an
instance of Object[]
.getResultList
in interface Stage.Query<R>
List
Query.getResultList()