CosmosQuery Class
- java.
lang. Object - com.
azure. spring. data. cosmos. core. query. CosmosQuery
- com.
public class CosmosQuery
Class for cosmos query
Constructor Summary
| Constructor | Description |
|---|---|
| CosmosQuery(Criteria criteria) |
Initialization |
Method Summary
| 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 |
| long |
getOffset()
To get offset number |
| org.springframework.data.domain.Pageable |
getPageable()
To get Pageable object |
| 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 Document |
| void |
setLimit(int limit)
Deprecated
use with
To set limit number |
|
Cosmos |
with(Pageable pageable)
With Sort |
|
Cosmos |
with(Sort sort)
With Sort |
|
Cosmos |
withLimit(int limit)
To set limit number |
|
Cosmos |
withOffsetAndLimit(long offset, int limit)
To set limit number and offset number |
Methods inherited from java.lang.Object
Constructor Details
CosmosQuery
public CosmosQuery(Criteria criteria)
Initialization
Parameters:
Method Details
getCriteria
public Criteria getCriteria()
To get Criteria object
Returns:
getCriteriaByType
public Optional<Criteria> getCriteriaByType(CriteriaType criteriaType)
To get criteria by type
Parameters:
Returns:
getLimit
public int getLimit()
To get limit number
Returns:
getOffset
public long getOffset()
To get offset number
Returns:
getPageable
public Pageable getPageable()
To get Pageable object
Returns:
getPartitionKeyValue
public Optional<Object> <T>getPartitionKeyValue(Class<T> domainType)
Returns partition key value based on the criteria.
Parameters:
Returns:
getSort
public Sort getSort()
To get Sort object
Returns:
hasPartitionKeyCriteria
public boolean hasPartitionKeyCriteria(String partitionKeyFieldName)
Returns true if this criteria or sub-criteria has partition key field present as one of the subjects.
Parameters:
Returns:
isCrossPartitionQuery
public boolean isCrossPartitionQuery(List<String> partitionKeys)
Indicate if DocumentQuery should enable cross partition query.
Parameters:
Returns:
setLimit
@Deprecated
public void setLimit(int limit)
Deprecated
To set limit number
Parameters:
with
public CosmosQuery with(Pageable pageable)
With Sort
Parameters:
Returns:
with
public CosmosQuery with(Sort sort)
With Sort
Parameters:
Returns:
withLimit
public CosmosQuery withLimit(int limit)
To set limit number
Parameters:
Returns:
withOffsetAndLimit
public CosmosQuery withOffsetAndLimit(long offset, int limit)
To set limit number and offset number
Parameters:
Returns: