Interface PanacheReactiveQuery<Entity>
- All Superinterfaces:
PanacheQuery<io.smallrye.mutiny.Uni<Entity>,io.smallrye.mutiny.Uni<List<Entity>>, io.smallrye.mutiny.Uni<Boolean>, io.smallrye.mutiny.Uni<Long>>
- All Known Implementing Classes:
PanacheManagedReactiveQueryImpl,PanacheStatelessReactiveQueryImpl
public interface PanacheReactiveQuery<Entity>
extends PanacheQuery<io.smallrye.mutiny.Uni<Entity>,io.smallrye.mutiny.Uni<List<Entity>>,io.smallrye.mutiny.Uni<Boolean>,io.smallrye.mutiny.Uni<Long>>
-
Method Summary
Methods inherited from interface io.quarkus.hibernate.panache.PanacheQuery
count, filter, filter, firstPage, firstResult, hasNextPage, hasPreviousPage, lastPage, list, nextPage, page, page, page, pageCount, previousPage, range, singleResult, withHint, withLock
-
Method Details
-
project
<T> PanacheQuery<io.smallrye.mutiny.Uni<T>,io.smallrye.mutiny.Uni<List<T>>, projectBoolean, Long> (Class<T> type) Defines a projection class. This will transform the returned values into instances of the given type using the following mapping rules:- If your query already selects some specific columns (starts with
select distinct? a, b, c…) then we transform it into a query of the form:select distinct? new ProjectionClass(a, b, c)…. There must be a matching constructor that accepts the selected column types, in the right order. - If your query does not select any specific column (starts with
from…) then we transform it into a query of the form:select new ProjectionClass(a, b, c…) from…where we fetch the list of selected columns from your projection class' single constructor, using its parameter names (or theirProjectedFieldNameannotations), in the same order as the constructor. - If this is already a project query of the form
select distinct? new…, we throw aPanacheQueryException
- Parameters:
type- the projected class type- Returns:
- a new query with the same state as the previous one (params, page, range, lockMode, hints, ...) but a projected
result of the type
type - Throws:
io.quarkus.panache.common.exception.PanacheQueryException- if this represents an already-projected query
- If your query already selects some specific columns (starts with
-