ListQuery

data class ListQuery(val condition: Condition, val projection: Projection = Projection.ALL, val sort: List<Sort> = emptyList(), val limit: Int = Pagination.DEFAULT.size) : IListQuery

Data class representing a query for retrieving a list of items with optional filtering, projection, sorting, and limiting.

This class implements IListQuery and provides a concrete implementation for list-based queries. It supports all standard query operations including conditions, projections, sorting, and result limiting.

Samples

Constructors

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

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 limit: Int

The maximum number of items to return. Defaults to the standard pagination size.

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): IListQuery

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): IListQuery

Appends a tenant ID condition to filter results by tenant.

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

Creates a new ListQuery with the specified condition.

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

Creates a new ListQuery with the specified projection.