Package org.hibernate.reactive.mutiny
Interface Mutiny.AbstractQuery
- All Known Subinterfaces:
Mutiny.MutationQuery
,Mutiny.Query<R>
,Mutiny.SelectionQuery<R>
- All Known Implementing Classes:
MutinyMutationQueryImpl
,MutinyQueryImpl
,MutinySelectionQueryImpl
- Enclosing interface:
- Mutiny
public static interface Mutiny.AbstractQuery
A non-blocking counterpart to the Hibernate
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.
Note that TemporalType
is not supported
as an argument for parameter bindings, and so parameters of type
Date
or Calendar
should not be
used. Instead, datetime types from java.time
should be used
as parameters.
- See Also:
-
Query
-
Method Summary
Modifier and TypeMethodDescriptionsetComment
(String comment) Set the comment for this query.setParameter
(int parameter, Object argument) Set the value of an ordinal parameter.setParameter
(jakarta.persistence.Parameter<T> parameter, T argument) Set the value of a typed parameter.setParameter
(String parameter, Object argument) Set the value of a named parameter.
-
Method Details
-
setParameter
Set the value of an ordinal parameter. Ordinal parameters are numbered from 1, and are specified in the query using placeholder tokens of form?1
,?2
, etc.- Parameters:
parameter
- an integer identifying the ordinal parameterargument
- the argument to set
-
setParameter
Set the value of a named parameter. Named parameters are specified in the query using placeholder tokens of form:name
.- Parameters:
parameter
- the name of the parameterargument
- the argument to set
-
setParameter
Set the value of a typed parameter. Typed parameters are obtained from the JPACriteriaBuilder
, which may itself be obtained by callingMutiny.SessionFactory.getCriteriaBuilder()
.- Parameters:
parameter
- the parameterargument
- the argument to set- See Also:
-
CriteriaBuilder.parameter(Class)
-
setComment
Set the comment for this query. This comment will be prepended to the SQL query sent to the database.- Parameters:
comment
- The human-readable comment
-
getComment
String getComment()
-