Interface QueryMapper.MapperSkip

All Superinterfaces:
QueryMapper.MapperQueryBuild
Enclosing interface:
QueryMapper

public static interface QueryMapper.MapperSkip extends QueryMapper.MapperQueryBuild
Represents the step in the fluent query API where the position of the first result to retrieve has been defined and it is still possible to further refine pagination or execute the query.

This interface is typically reached after invoking skip(long) and allows specifying a maximum number of results or proceeding directly to query execution.

@Inject
Template template;

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

    • limit

      QueryMapper.MapperLimit limit(long limit)
      Defines the maximum number of results to retrieve (pagination limit).
      template.select(Book.class)
              .where("author").eq("Ada")
              .limit(5);
      
      Parameters:
      limit - the limit
      Returns:
      a query with the limit defined
      Throws:
      IllegalArgumentException - when limit is negative