Interface PanacheBlockingQuery<Entity>
- All Superinterfaces:
PanacheQuery<Entity,List<Entity>, Boolean, Long>
- All Known Implementing Classes:
PanacheBlockingQueryImpl
public interface PanacheBlockingQuery<Entity>
extends PanacheQuery<Entity,List<Entity>,Boolean,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
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 theirannotations), in the same order as the constructor.invalid reference
ProjectedFieldName - If this is already a project query of the form
select distinct? new…, we throw ainvalid reference
PanacheQueryException
- 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
- If your query already selects some specific columns (starts with
-
stream
Returns the current page of results as aStream.- Returns:
- the current page of results as a
Stream. - See Also:
-
firstResultOptional
Returns the first result of the current page index. This ignores the current page size to fetch a single result.- Returns:
- if found, an optional containing the entity, else
Optional.empty(). - See Also:
-
singleResultOptional
Executes this query for the current page and return a single result.- Returns:
- if found, an optional containing the entity, else
Optional.empty(). - Throws:
jakarta.persistence.NonUniqueResultException- if there are more than one result- See Also:
-