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