public static interface Mutiny.Query<R>
Query
interface, allowing reactive
execution of HQL and JPQL queries.
The semantics of operations on this interface are identical to the
semantics of the similarly-named operations of Query
, except
that the operations are performed asynchronously, returning a
Uni
without blocking the calling thread.Query
Modifier and Type | Method and Description |
---|---|
io.smallrye.mutiny.Uni<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. |
io.smallrye.mutiny.Uni<java.util.List<R>> |
getResultList()
Asynchronously execute this query, return the query results
as a
List . |
io.smallrye.mutiny.Uni<R> |
getSingleResult()
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 result. |
Mutiny.Query<R> |
setCacheMode(org.hibernate.CacheMode cacheMode)
(Re)set the current
CacheMode in effect for this query. |
Mutiny.Query<R> |
setComment(java.lang.String comment)
Set the comment for this query.
|
Mutiny.Query<R> |
setFirstResult(int firstResult) |
Mutiny.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). |
Mutiny.Query<R> |
setMaxResults(int maxResults) |
Mutiny.Query<R> |
setParameter(int position,
java.lang.Object value) |
<T> Mutiny.Query<R> |
setParameter(javax.persistence.Parameter<T> name,
T value) |
Mutiny.Query<R> |
setParameter(java.lang.String name,
java.lang.Object value) |
Mutiny.Query<R> |
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies
loaded by this Query.
|
Mutiny.Query<R> setParameter(int position, java.lang.Object value)
Mutiny.Query<R> setParameter(java.lang.String name, java.lang.Object value)
<T> Mutiny.Query<R> setParameter(javax.persistence.Parameter<T> name, T value)
Mutiny.Query<R> setMaxResults(int maxResults)
Mutiny.Query<R> setFirstResult(int firstResult)
io.smallrye.mutiny.Uni<R> getSingleResult()
null
if the query returns
no results, throwing an exception if the query returns more
than one matching result.Query.getSingleResult()
io.smallrye.mutiny.Uni<java.util.List<R>> getResultList()
List
. If the query contains multiple results per
row, the results are returned in an instance of Object[].List
Query.getResultList()
io.smallrye.mutiny.Uni<java.lang.Integer> executeUpdate()
Query.executeUpdate()
Mutiny.Query<R> setReadOnly(boolean readOnly)
Mutiny.Query<R> setComment(java.lang.String comment)
comment
- The human-readable commentMutiny.Query<R> setCacheMode(org.hibernate.CacheMode cacheMode)
CacheMode
in effect for this query.org.hibernate.CacheMode getCacheMode()
CacheMode
in effect for this query. By default,
the query inherits the CacheMode
of the Mutiny.Session
from which is originates.Mutiny.Session.getCacheMode()
Mutiny.Query<R> setLockMode(java.lang.String alias, org.hibernate.LockMode lockMode)
LockMode
to use for specified alias (as defined in
the query's FROM clause).Query.setLockMode(String,LockMode)