Interface QueryMapper.MapperNameOrder
- All Superinterfaces:
-
QueryMapper.MapperQueryBuild
- Enclosing interface:
-
QueryMapper
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 Summary
Methods inherited from interface QueryMapper.MapperQueryBuild
count, result, singleResult, stream
-
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.MapperOrderinstance for defining the sort direction - Throws:
-
NullPointerException- if name is null
-
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.MapperSkipinstance for chaining
-
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.MapperLimitinstance for chaining - Throws:
-
IllegalArgumentException- if limit is negative
-