public class QueryRequestAdapter<T> extends java.lang.Object implements QueryRequest<T>
Constructor and Description |
---|
QueryRequestAdapter(QueryRequest<T> request) |
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.
|
play.libs.F.Promise<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.
|
public QueryRequestAdapter(@Nonnull QueryRequest<T> request)
public QueryResult<T> fetch()
QueryRequest
fetch
in interface QueryRequest<T>
public play.libs.F.Promise<QueryResult<T>> fetchAsync()
QueryRequest
fetchAsync
in interface QueryRequest<T>
public QueryRequest<T> page(int page)
QueryRequest
page
in interface QueryRequest<T>
public QueryRequest<T> pageSize(int pageSize)
QueryRequest
pageSize
in interface QueryRequest<T>
public QueryRequest<T> expand(java.lang.String... paths)
QueryRequest
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"
}
}
}
expand
in interface QueryRequest<T>
paths
- The paths to be expanded, such as 'customerGroup'.