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