Interface QueryMapper.MapperFrom

All Superinterfaces:
QueryMapper.MapperQueryBuild
Enclosing interface:
QueryMapper

public static interface QueryMapper.MapperFrom extends QueryMapper.MapperQueryBuild
Represents the initial step of the fluent query API.

This interface is the entry point for building selection queries and provides operations to define filtering conditions, pagination, and result ordering before executing the query.

@Inject
Template template;

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

    • where

      Starts a new condition by specifying a column name. Use this method to initiate a condition chain for filtering the query.
       template.select(Book.class)
               .where("title").eq("Domain-Driven Design");
       
      Parameters:
      name - the column name
      Returns:
      a new QueryMapper.MapperNameCondition
      Throws:
      NullPointerException - when name is null
    • skip

      QueryMapper.MapperSkip skip(long skip)
      Defines the position of the first result to retrieve (pagination offset).
      template.select(Book.class)
              .where("author").eq("Ada")
              .skip(10);
      
      Parameters:
      skip - the first result to retrieve
      Returns:
      a query with the first result defined
      Throws:
      IllegalArgumentException - when skip is negative
    • 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
    • orderBy

      Add the order how the result will return based on a given column name. Use this method to specify sorting criteria for query results.

      Example:

      template.select(Book.class)
              .where("author").eq("Ada")
              .orderBy("title").asc();
      
      Parameters:
      name - the column name to be ordered
      Returns:
      a query with the sort defined
      Throws:
      NullPointerException - when name is null