API reference
API reference
Select your platform
No SDKs available
No versions available

SortBuilder

SortBuilder

class SortBuilder
A builder class for constructing sorting criteria and configurations.
This builder provides an API for defining complex sorting operations, including:
  • Multiple sort criteria with different attribute types
  • Pagination through the take method
  • Building the final sort configuration
Example usage -- Sort by the intVar attribute of the TestComponent; if there’s a tie, sort by the stringVar attribute, ignoring case. Take the first 10 items:
val sortConfig = Query.where{ has(TestComponent.id) }
                      .with {
                        by(TestComponent.intVarData)
                        by(TestComponent.stringVarData).descCaseInsensitive()
                       }.take(0, 10)

Constructors

NameSummary
SortBuilder
constructor()

Functions

NameSummary
take
fun take(offset: Int, count: Int): SortBuilder

Defines the range of sorting results by specifying the starting index and the number of items to include.
with
fun with(init: SortCriteriaBuilder.() -> Unit): SortBuilder

Configures the sorting criteria using a lambda function.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon