public interface OrderQuery extends MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>
MAX_OFFSET, MIN_OFFSET| Modifier and Type | Method and Description |
|---|---|
default OrderQuery |
byCustomerEmail(String customerEmail) |
default OrderQuery |
byCustomerId(String customerId) |
static OrderQuery |
of() |
OrderQuery |
plusExpansionPaths(Function<OrderExpansionModel<Order>,ExpansionPathContainer<Order>> m)
Creates a new object with the properties of the old object but adds a new expansion path to it by using meta models.
|
OrderQuery |
plusPredicates(Function<OrderQueryModel,QueryPredicate<Order>> m)
Returns a new instance with the new predicate appended (AND semantics).
|
OrderQuery |
plusPredicates(List<QueryPredicate<Order>> queryPredicates)
Returns a new instance with the new predicate list appended to the existing predicates (AND semantic).
|
OrderQuery |
plusPredicates(QueryPredicate<Order> queryPredicate)
Returns a new instance with the new predicate appended to the existing predicates (AND semantic).
|
OrderQuery |
plusSort(Function<OrderQueryModel,QuerySort<Order>> m)
Returns a query with the sort expression appended to the existing ones.
|
OrderQuery |
plusSort(List<QuerySort<Order>> sort)
Returns a query with the sort expressions appended to the existing ones.
|
OrderQuery |
plusSort(QuerySort<Order> sort)
Returns a query with the sort expression appended to the existing ones.
|
static com.fasterxml.jackson.core.type.TypeReference<PagedQueryResult<Order>> |
resultTypeReference()
Creates a container which contains the full Java type information to deserialize the query result (NOT this class) from JSON.
|
OrderQuery |
withExpansionPaths(Function<OrderExpansionModel<Order>,ExpansionPathContainer<Order>> 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. |
OrderQuery |
withFetchTotal(boolean fetchTotal)
Enables/disables a flag it the total amount of items should be counted.
|
OrderQuery |
withLimit(Long limit)
Creates a new instance which a limited amount of results.
|
OrderQuery |
withOffset(Long offset)
Returns a new query with the new offset as offset.
|
OrderQuery |
withPredicates(Function<OrderQueryModel,QueryPredicate<Order>> predicateFunction)
Returns a new instance with the new predicate as only predicate.
|
OrderQuery |
withPredicates(List<QueryPredicate<Order>> queryPredicates)
Returns a new instance with the new predicate list as predicates.
|
OrderQuery |
withPredicates(QueryPredicate<Order> queryPredicate)
Returns a new instance with the new predicate as only predicate.
|
OrderQuery |
withSort(Function<OrderQueryModel,QuerySort<Order>> m)
Returns a query with the new sort as only sort parameter.
|
OrderQuery |
withSort(List<QuerySort<Order>> sort)
Returns a query with the new sort list as only sort parameters.
|
OrderQuery |
withSort(QuerySort<Order> sort)
Returns a query with the new sort as only sort parameter.
|
OrderQuery |
withSortMulti(Function<OrderQueryModel,List<QuerySort<Order>>> m)
Returns a query with the new sort list as only sort parameters.
|
plusPredicates, plusSort, withPredicates, withQueryParam, withSortwithLimit, withOffsetendpoint, expansionPaths, fetchTotal, limit, offset, predicates, sortdeserialize, toQuerycanDeserialize, httpRequestIntentplusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPathsstatic com.fasterxml.jackson.core.type.TypeReference<PagedQueryResult<Order>> resultTypeReference()
static OrderQuery of()
OrderQuery plusPredicates(Function<OrderQueryModel,QueryPredicate<Order>> m)
MetaModelQueryDslplusPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>m - function given a meta model description of the model return a QueryPredicateMetaModelQueryDsl.withPredicates(Function)OrderQuery plusPredicates(QueryPredicate<Order> queryPredicate)
QueryDslplusPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>plusPredicates in interface QueryDsl<Order,OrderQuery>queryPredicate - the new predicateQueryDsl.withPredicates(QueryPredicate)OrderQuery plusPredicates(List<QueryPredicate<Order>> queryPredicates)
QueryDslplusPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>plusPredicates in interface QueryDsl<Order,OrderQuery>queryPredicates - the new predicate listQueryDsl.withPredicates(List)OrderQuery plusSort(Function<OrderQueryModel,QuerySort<Order>> m)
MetaModelQueryDslplusSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>m - function given a meta model description of the model returns a list of QuerySortMetaModelQueryDsl.withSort(Function)OrderQuery plusSort(List<QuerySort<Order>> sort)
QueryDslplusSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>plusSort in interface QueryDsl<Order,OrderQuery>sort - sort expressions how the results of the query should be sortedQueryDsl.withSort(List)OrderQuery plusSort(QuerySort<Order> sort)
QueryDslplusSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>plusSort in interface QueryDsl<Order,OrderQuery>sort - sort expression how the results of the query should be sortedQueryDsl.withSort(QuerySort)OrderQuery withPredicates(Function<OrderQueryModel,QueryPredicate<Order>> predicateFunction)
MetaModelQueryDslwithPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>predicateFunction - function given a meta model description of the model return a QueryPredicateMetaModelQueryDsl.plusPredicates(Function)OrderQuery withPredicates(QueryPredicate<Order> queryPredicate)
QueryDslwithPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>withPredicates in interface QueryDsl<Order,OrderQuery>queryPredicate - the new predicateQueryDsl.plusPredicates(QueryPredicate)OrderQuery withPredicates(List<QueryPredicate<Order>> queryPredicates)
QueryDslwithPredicates in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>withPredicates in interface QueryDsl<Order,OrderQuery>queryPredicates - the new predicate listQueryDsl.plusPredicates(List)OrderQuery withSort(Function<OrderQueryModel,QuerySort<Order>> m)
MetaModelQueryDslwithSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>m - function given a meta model description of the model returns a QuerySortMetaModelQueryDsl.plusSort(Function)OrderQuery withSort(List<QuerySort<Order>> sort)
QueryDslwithSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>withSort in interface QueryDsl<Order,OrderQuery>sort - list of sorts how the results of the query should be sortedQueryDsl.plusSort(List)OrderQuery withSort(QuerySort<Order> sort)
QueryDslwithSort in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>withSort in interface QueryDsl<Order,OrderQuery>sort - sort expression how the results of the query should be sortedQueryDsl.plusSort(QuerySort)OrderQuery withSortMulti(Function<OrderQueryModel,List<QuerySort<Order>>> m)
MetaModelQueryDslwithSortMulti in interface MetaModelQueryDsl<Order,OrderQuery,OrderQueryModel,OrderExpansionModel<Order>>m - function given a meta model description of the model returns a list of QuerySortMetaModelQueryDsl.plusSort(List),
MetaModelQueryDsl.withSort(Function)OrderQuery plusExpansionPaths(Function<OrderExpansionModel<Order>,ExpansionPathContainer<Order>> m)
MetaModelReferenceExpansionDslAn 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<Order,OrderQuery,OrderExpansionModel<Order>>m - function to use the meta model for expansions to create an expansion pathOrderQuery withExpansionPaths(Function<OrderExpansionModel<Order>,ExpansionPathContainer<Order>> m)
MetaModelReferenceExpansionDslexpansionPath 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<Order,OrderQuery,OrderExpansionModel<Order>>m - function to use the meta model for expansions to create an expansion pathOrderQuery withFetchTotal(boolean fetchTotal)
QueryDslIf fetchTotal is true then PagedQueryResult.getTotal() is null.
withFetchTotal in interface QueryDsl<Order,OrderQuery>fetchTotal - enable the total count if true (default on the construction of the QueryDsl).QueryDsl as this instance but with the updated flagOrderQuery withLimit(Long limit)
QueryDslwithLimit in interface QueryDsl<Order,OrderQuery>limit - the maximum amount of items of T which should be included in the PagedQueryResult.PagedQueryResult.getResults()OrderQuery withOffset(Long offset)
QueryDslwithOffset in interface QueryDsl<Order,OrderQuery>offset - the number of items which should be omitted in the query result.default OrderQuery byCustomerId(String customerId)
default OrderQuery byCustomerEmail(String customerEmail)