PanacheQueryImpl

Functions

Link copied to clipboard
open override fun count(): Uni<Long>

Reads and caches the total number of entities this query operates on. This causes a database query with SELECT COUNT(*) and a query equivalent to the current query, minus ordering.

Link copied to clipboard
open override fun filter(filterName: String): PanacheQuery<Entity>
open override fun filter(filterName: String, parameters: Parameters): PanacheQuery<Entity>
open override fun filter(filterName: String, parameters: Map<String, Any>): PanacheQuery<Entity>

Enables a Hibernate filter during fetching of results for this query. Your filter must be declared with [FilterDef] on your entity or package, and enabled with [Filter] on your entity.

Link copied to clipboard
open override fun firstPage(): PanacheQuery<Entity>

Sets the current page to the first page

Link copied to clipboard
open override fun firstResult(): Uni<Entity?>

Returns the first result of the current page index. This ignores the current page size to fetch a single result.

Link copied to clipboard
open override fun hasNextPage(): Uni<Boolean>

Returns true if there is another page to read after the current one. This will cause reading of the entity count.

Link copied to clipboard
open override fun hasPreviousPage(): Boolean

Returns true if there is a page to read before the current one.

Link copied to clipboard
open override fun lastPage(): Uni<PanacheQuery<Entity>>

Sets the current page to the last page. This will cause reading of the entity count.

Link copied to clipboard
open override fun list(): Uni<List<Entity>>

Returns the current page of results as a List.

Link copied to clipboard
open override fun nextPage(): PanacheQuery<Entity>

Sets the current page to the next page

Link copied to clipboard
open override fun page(): Page

Returns the current page.

open override fun page(page: Page): PanacheQuery<Entity>
open override fun page(pageIndex: Int, pageSize: Int): PanacheQuery<Entity>

Sets the current page.

Link copied to clipboard
open override fun pageCount(): Uni<Int>

Returns the total number of pages to be read using the current page size. This will cause reading of the entity count.

Link copied to clipboard
open override fun previousPage(): PanacheQuery<Entity>

Sets the current page to the previous page (or the first page if there is no previous page)

Link copied to clipboard
open override fun <NewEntity : Any> project(type: Class<NewEntity>): PanacheQuery<NewEntity>

Defines a projection class: the getters, and the public fields, will be used to restrict which fields should be retrieved from the database.

Link copied to clipboard
open override fun range(startIndex: Int, lastIndex: Int): PanacheQuery<Entity>

Switch the query to use a fixed range (start index - last index) instead of a page. As the range is fixed, subsequent pagination of the query is not possible.

Link copied to clipboard
open override fun singleResult(): Uni<Entity>

Executes this query for the current page and return a single result.

Link copied to clipboard
open override fun withHint(hintName: String, value: Any): PanacheQuery<Entity>

Set a query property or hint on the underlying JPA Query.

Link copied to clipboard
open override fun withLock(lockModeType: LockModeType): PanacheQuery<Entity>

Define the locking strategy used for this query.