public class CosmosQuery extends Object
| Constructor and Description |
|---|
CosmosQuery(Criteria criteria)
Initialization
|
| Modifier and Type | Method and Description |
|---|---|
Criteria |
getCriteria()
To get Criteria object
|
Optional<Criteria> |
getCriteriaByType(CriteriaType criteriaType)
To get criteria by type
|
int |
getLimit()
To get limit number
|
org.springframework.data.domain.Pageable |
getPageable()
To get Pageable object
|
<T> Optional<Object> |
getPartitionKeyValue(Class<T> domainType)
Returns partition key value based on the criteria.
|
org.springframework.data.domain.Sort |
getSort()
To get Sort object
|
boolean |
hasPartitionKeyCriteria(String partitionKeyFieldName)
Returns true if this criteria or sub-criteria has partition key field present as one of the subjects.
|
boolean |
isCrossPartitionQuery(List<String> partitionKeys)
Indicate if DocumentQuery should enable cross partition query.
|
void |
setLimit(int limit)
To set limit number
|
CosmosQuery |
with(org.springframework.data.domain.Pageable pageable)
With Sort
|
CosmosQuery |
with(org.springframework.data.domain.Sort sort)
With Sort
|
public CosmosQuery(@NonNull
Criteria criteria)
criteria - objectpublic Criteria getCriteria()
public org.springframework.data.domain.Sort getSort()
public org.springframework.data.domain.Pageable getPageable()
public int getLimit()
public void setLimit(int limit)
limit - intpublic CosmosQuery with(@NonNull org.springframework.data.domain.Sort sort)
sort - Sortpublic CosmosQuery with(@NonNull org.springframework.data.domain.Pageable pageable)
pageable - Sortpublic boolean isCrossPartitionQuery(@NonNull
List<String> partitionKeys)
partitionKeys - The list of partitionKey names.public boolean hasPartitionKeyCriteria(@NonNull
String partitionKeyFieldName)
partitionKeyFieldName - partition key field namepublic <T> Optional<Object> getPartitionKeyValue(@NonNull Class<T> domainType)
T - entity class typedomainType - domain typepublic Optional<Criteria> getCriteriaByType(@NonNull CriteriaType criteriaType)
criteriaType - the criteria typeCopyright © 2021 Microsoft Corporation. All rights reserved.