PagedQuery

data class PagedQuery(val condition: Condition, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList(), val pagination: Pagination = Pagination.DEFAULT) : IPagedQuery

Data class representing a paginated query with filtering, projection, sorting, and pagination.

This class implements IPagedQuery and provides a concrete implementation for queries that need to retrieve results in pages with support for all standard query operations.

Samples

Constructors

Link copied to clipboard
constructor(condition: Condition, projection: Projection = Projection.ALL, sort: List<Sort> = emptyList(), pagination: Pagination = Pagination.DEFAULT)

Properties

Link copied to clipboard
open override val condition: Condition

The filtering condition to apply to the query.

Link copied to clipboard
open override val pagination: Pagination

The pagination settings to control which page and how many items to return.

Link copied to clipboard
open override val projection: Projection

The field projection to control which fields are included in the results.

Link copied to clipboard
open override val sort: List<Sort>

The sorting criteria to order the results.

Functions

Link copied to clipboard
open override fun appendCondition(append: Condition): IPagedQuery

Appends a condition to the existing condition using logical AND. This method combines the current condition with the appended condition.

Link copied to clipboard
open fun appendTenantId(tenantId: String): IPagedQuery

Appends a tenant ID condition to filter results by tenant.

Link copied to clipboard
open override fun withCondition(newCondition: Condition): IPagedQuery

Creates a new PagedQuery with the specified condition.

Link copied to clipboard
open override fun withProjection(newProjection: Projection): IPagedQuery

Creates a new PagedQuery with the specified projection.