public interface ShoppingListInStoreQuery extends MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
MAX_OFFSET, MIN_OFFSET
Modifier and Type | Method and Description |
---|---|
static ShoppingListInStoreQuery |
of(String storeKey) |
ShoppingListInStoreQuery |
plusExpansionPaths(Function<ShoppingListExpansionModel<ShoppingList>,ExpansionPathContainer<ShoppingList>> m)
Creates a new object with the properties of the old object but adds a new expansion path to it by using meta models.
|
ShoppingListInStoreQuery |
plusPredicates(Function<ShoppingListQueryModel,QueryPredicate<ShoppingList>> m)
Returns a new instance with the new predicate appended (AND semantics).
|
ShoppingListInStoreQuery |
plusPredicates(List<QueryPredicate<ShoppingList>> queryPredicates)
Returns a new instance with the new predicate list appended to the existing predicates (AND semantic).
|
ShoppingListInStoreQuery |
plusPredicates(QueryPredicate<ShoppingList> queryPredicate)
Returns a new instance with the new predicate appended to the existing predicates (AND semantic).
|
ShoppingListInStoreQuery |
plusSort(Function<ShoppingListQueryModel,QuerySort<ShoppingList>> m)
Returns a query with the sort expression appended to the existing ones.
|
ShoppingListInStoreQuery |
plusSort(List<QuerySort<ShoppingList>> sort)
Returns a query with the sort expressions appended to the existing ones.
|
ShoppingListInStoreQuery |
plusSort(QuerySort<ShoppingList> sort)
Returns a query with the sort expression appended to the existing ones.
|
static com.fasterxml.jackson.core.type.TypeReference<PagedQueryResult<ShoppingList>> |
resultTypeReference()
Creates a container which contains the full Java type information to deserialize the query result (NOT this class) from JSON.
|
ShoppingListInStoreQuery |
withExpansionPaths(Function<ShoppingListExpansionModel<ShoppingList>,ExpansionPathContainer<ShoppingList>> m)
Creates a new object with the properties of the old object but replaces all expansion paths with a single
expansionPath by using meta models. |
ShoppingListInStoreQuery |
withFetchTotal(boolean fetchTotal)
Enables/disables a flag it the total amount of items should be counted.
|
ShoppingListInStoreQuery |
withLimit(Long limit)
Creates a new instance which a limited amount of results.
|
ShoppingListInStoreQuery |
withOffset(Long offset)
Returns a new query with the new offset as offset.
|
ShoppingListInStoreQuery |
withPredicates(Function<ShoppingListQueryModel,QueryPredicate<ShoppingList>> predicateFunction)
Returns a new instance with the new predicate as only predicate.
|
ShoppingListInStoreQuery |
withPredicates(List<QueryPredicate<ShoppingList>> queryPredicates)
Returns a new instance with the new predicate list as predicates.
|
ShoppingListInStoreQuery |
withPredicates(QueryPredicate<ShoppingList> queryPredicate)
Returns a new instance with the new predicate as only predicate.
|
ShoppingListInStoreQuery |
withSort(Function<ShoppingListQueryModel,QuerySort<ShoppingList>> m)
Returns a query with the new sort as only sort parameter.
|
ShoppingListInStoreQuery |
withSort(List<QuerySort<ShoppingList>> sort)
Returns a query with the new sort list as only sort parameters.
|
ShoppingListInStoreQuery |
withSort(QuerySort<ShoppingList> sort)
Returns a query with the new sort as only sort parameter.
|
ShoppingListInStoreQuery |
withSortMulti(Function<ShoppingListQueryModel,List<QuerySort<ShoppingList>>> m)
Returns a query with the new sort list as only sort parameters.
|
plusPredicates, plusSort, withPredicates, withQueryParam, withSort
withLimit, withOffset
endpoint, expansionPaths, fetchTotal, limit, offset, predicates, sort
deserialize, toQuery
canDeserialize, httpRequestIntent
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
static com.fasterxml.jackson.core.type.TypeReference<PagedQueryResult<ShoppingList>> resultTypeReference()
static ShoppingListInStoreQuery of(String storeKey)
ShoppingListInStoreQuery plusPredicates(Function<ShoppingListQueryModel,QueryPredicate<ShoppingList>> m)
MetaModelQueryDsl
plusPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
m
- function given a meta model description of the model return a QueryPredicate
MetaModelQueryDsl.withPredicates(Function)
ShoppingListInStoreQuery plusPredicates(QueryPredicate<ShoppingList> queryPredicate)
QueryDsl
plusPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
plusPredicates
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
queryPredicate
- the new predicateQueryDsl.withPredicates(QueryPredicate)
ShoppingListInStoreQuery plusPredicates(List<QueryPredicate<ShoppingList>> queryPredicates)
QueryDsl
plusPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
plusPredicates
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
queryPredicates
- the new predicate listQueryDsl.withPredicates(List)
ShoppingListInStoreQuery plusSort(Function<ShoppingListQueryModel,QuerySort<ShoppingList>> m)
MetaModelQueryDsl
plusSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
m
- function given a meta model description of the model returns a list of QuerySort
MetaModelQueryDsl.withSort(Function)
ShoppingListInStoreQuery plusSort(List<QuerySort<ShoppingList>> sort)
QueryDsl
plusSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
plusSort
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
sort
- sort expressions how the results of the query should be sortedQueryDsl.withSort(List)
ShoppingListInStoreQuery plusSort(QuerySort<ShoppingList> sort)
QueryDsl
plusSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
plusSort
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
sort
- sort expression how the results of the query should be sortedQueryDsl.withSort(QuerySort)
ShoppingListInStoreQuery withPredicates(Function<ShoppingListQueryModel,QueryPredicate<ShoppingList>> predicateFunction)
MetaModelQueryDsl
withPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
predicateFunction
- function given a meta model description of the model return a QueryPredicate
MetaModelQueryDsl.plusPredicates(Function)
ShoppingListInStoreQuery withPredicates(QueryPredicate<ShoppingList> queryPredicate)
QueryDsl
withPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
withPredicates
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
queryPredicate
- the new predicateQueryDsl.plusPredicates(QueryPredicate)
ShoppingListInStoreQuery withPredicates(List<QueryPredicate<ShoppingList>> queryPredicates)
QueryDsl
withPredicates
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
withPredicates
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
queryPredicates
- the new predicate listQueryDsl.plusPredicates(List)
ShoppingListInStoreQuery withSort(Function<ShoppingListQueryModel,QuerySort<ShoppingList>> m)
MetaModelQueryDsl
withSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
m
- function given a meta model description of the model returns a QuerySort
MetaModelQueryDsl.plusSort(Function)
ShoppingListInStoreQuery withSort(List<QuerySort<ShoppingList>> sort)
QueryDsl
withSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
withSort
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
sort
- list of sorts how the results of the query should be sortedQueryDsl.plusSort(List)
ShoppingListInStoreQuery withSort(QuerySort<ShoppingList> sort)
QueryDsl
withSort
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
withSort
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
sort
- sort expression how the results of the query should be sortedQueryDsl.plusSort(QuerySort)
ShoppingListInStoreQuery withSortMulti(Function<ShoppingListQueryModel,List<QuerySort<ShoppingList>>> m)
MetaModelQueryDsl
withSortMulti
in interface MetaModelQueryDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListQueryModel,ShoppingListExpansionModel<ShoppingList>>
m
- function given a meta model description of the model returns a list of QuerySort
MetaModelQueryDsl.plusSort(List)
,
MetaModelQueryDsl.withSort(Function)
ShoppingListInStoreQuery plusExpansionPaths(Function<ShoppingListExpansionModel<ShoppingList>,ExpansionPathContainer<ShoppingList>> m)
MetaModelReferenceExpansionDsl
An example in the product projection context:
final ProductProjectionByIdGet fetch1 = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .plusExpansionPaths(m -> m.categories()); assertThat(fetch1.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"))); final ProductProjectionByIdGet fetch2 = fetch1.plusExpansionPaths(m -> m.productType()); assertThat(fetch2.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"), ExpansionPath.of("productType"))) .isEqualTo(listOf(fetch1.expansionPaths(), ExpansionPath.of("productType"))); //this is equivalent to final ExpansionPath<ProductProjection> categoryExpand = ProductProjectionExpansionModel.of().categories().expansionPaths().get(0); final ExpansionPath<ProductProjection> productTypeExpand = ProductProjectionExpansionModel.of().productType().expansionPaths().get(0); final ProductProjectionByIdGet fetchB = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .withExpansionPaths(asList(categoryExpand, productTypeExpand)); assertThat(fetchB.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"), ExpansionPath.of("productType")));
See the test code.
plusExpansionPaths
in interface MetaModelReferenceExpansionDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListExpansionModel<ShoppingList>>
m
- function to use the meta model for expansions to create an expansion pathShoppingListInStoreQuery withExpansionPaths(Function<ShoppingListExpansionModel<ShoppingList>,ExpansionPathContainer<ShoppingList>> m)
MetaModelReferenceExpansionDsl
expansionPath
by using meta models.
An example in the product projection context:
final ProductProjectionByIdGet fetch = ProductProjectionByIdGet.of("id", ProductProjectionType.CURRENT) .plusExpansionPaths(ProductProjectionExpansionModel.of().categories()); assertThat(fetch.expansionPaths()) .isEqualTo(asList(ExpansionPath.of("categories[*]"))); final ProductProjectionByIdGet fetch2 = fetch.withExpansionPaths(m -> m.productType()); assertThat(fetch.expansionPaths()).overridingErrorMessage("old object is unchanged") .isEqualTo(asList(ExpansionPath.of("categories[*]"))); assertThat(fetch2.expansionPaths()).isEqualTo(asList(ExpansionPath.of("productType"))); assertThat(fetch2).isNotSameAs(fetch);
See the test code.
withExpansionPaths
in interface MetaModelReferenceExpansionDsl<ShoppingList,ShoppingListInStoreQuery,ShoppingListExpansionModel<ShoppingList>>
m
- function to use the meta model for expansions to create an expansion pathShoppingListInStoreQuery withFetchTotal(boolean fetchTotal)
QueryDsl
If fetchTotal
is true then PagedQueryResult.getTotal()
is null.
withFetchTotal
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
fetchTotal
- enable the total count if true (default on the construction of the QueryDsl).QueryDsl
as this instance but with the updated flagShoppingListInStoreQuery withLimit(Long limit)
QueryDsl
withLimit
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
limit
- the maximum amount of items of T
which should be included in the PagedQueryResult
.PagedQueryResult.getResults()
ShoppingListInStoreQuery withOffset(Long offset)
QueryDsl
withOffset
in interface QueryDsl<ShoppingList,ShoppingListInStoreQuery>
offset
- the number of items which should be omitted in the query result.