Interface QueryMapper.MapperNameOrder

All Superinterfaces:
QueryMapper.MapperQueryBuild
Enclosing interface:
QueryMapper

public static interface QueryMapper.MapperNameOrder extends QueryMapper.MapperQueryBuild
Represents the step in the fluent query API where result ordering, pagination, or query execution can be defined.

This interface is reached after filtering conditions have been specified and allows configuring the sort order of results, defining pagination parameters, or directly executing the query.

@Inject
Template template;

template.select(Book.class)
    .where("author").eq("Ada")
    .orderBy("title").asc()
    .limit(10)
    .result();
The returned instance is mutable and not thread-safe. Support for ordering and pagination features depends on the capabilities of the underlying NoSQL database.
Since:
1.0.0
  • Method Details

    • orderBy

      Adds an ordering rule based on the specified column name.
      template.select(Book.class)
              .where("author").eq("Ada")
              .orderBy("title").asc()
              .result();
      
      Parameters:
      name - the column name to order by
      Returns:
      the QueryMapper.MapperOrder instance for defining the sort direction
      Throws:
      NullPointerException - if name is null
    • skip

      QueryMapper.MapperSkip skip(long skip)
      Sets the number of results to skip before starting to return results.
      template.select(Book.class)
              .where("category").eq("Science")
              .skip(10)
              .result();
      
      Parameters:
      skip - the number of results to skip
      Returns:
      the QueryMapper.MapperSkip instance for chaining
    • limit

      QueryMapper.MapperLimit limit(long limit)
      Sets the maximum number of results to return.
      template.select(Book.class)
              .where("author").eq("Ada")
              .limit(5)
              .result();
      
      Parameters:
      limit - the maximum number of results to retrieve
      Returns:
      the QueryMapper.MapperLimit instance for chaining
      Throws:
      IllegalArgumentException - if limit is negative