public interface QueryRequest<T>
Modifier and Type | Method and Description |
---|---|
QueryRequest<T> |
expand(java.lang.String... paths)
Requests Reference fields to be expanded in the returned objects.
|
QueryResult<T> |
fetch()
Executes the request and returns the result.
|
com.google.common.util.concurrent.ListenableFuture<QueryResult<T>> |
fetchAsync()
Executes the request asynchronously and returns a future providing the result.
|
QueryRequest<T> |
page(int page)
Sets the page number for paging through results.
|
QueryRequest<T> |
pageSize(int pageSize)
Sets the size of a page for paging through results.
|
QueryRequest<T> |
sort(java.lang.String fieldName,
SortDirection sortDirection)
Sets the sort expression for sorting the result.
|
QueryRequest<T> |
where(java.lang.String predicate)
Sets the predicate used to filter the results for this query request.
|
QueryResult<T> fetch()
com.google.common.util.concurrent.ListenableFuture<QueryResult<T>> fetchAsync()
QueryRequest<T> where(java.lang.String predicate)
predicate
- The predicate which is used to filter the results.
Example: "name(en=\"myName\")".
QueryRequest<T> sort(java.lang.String fieldName, SortDirection sortDirection)
fieldName
- the attribute to sort with
Example: "name.en".
sortDirection
- The direction to sort with.QueryRequest<T> page(int page)
QueryRequest<T> pageSize(int pageSize)
QueryRequest<T> expand(java.lang.String... paths)
As an illustration, here is how reference expansion looks at the underlying JSON transport level. Given a customer object:
{
"name": "John Doe"
"customerGroup": {
"typeId": "customer-group",
"id": "7ba61480-6a72-4a2a-a72e-cd39f75a7ef2"
}
}
This is what the result looks like when the path 'customerGroup' has been expanded:
{
"name": "John Doe"
"customerGroup": {
typeId: "customer-group",
id: "7ba61480-6a72-4a2a-a72e-cd39f75a7ef2"
obj: {
"name": "Gold"
}
}
}
paths
- The paths to be expanded, such as 'customerGroup'.