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