Class AbstractCosmosQuery
- java.lang.Object
-
- com.azure.spring.data.cosmos.repository.query.AbstractCosmosQuery
-
- All Implemented Interfaces:
org.springframework.data.repository.query.RepositoryQuery
- Direct Known Subclasses:
PartTreeCosmosQuery,StringBasedCosmosQuery
public abstract class AbstractCosmosQuery extends Object implements org.springframework.data.repository.query.RepositoryQuery
Abstract class for cosmos query.
-
-
Field Summary
Fields Modifier and Type Field Description protected CosmosOperationsoperationsCosmosOperations
-
Constructor Summary
Constructors Constructor Description AbstractCosmosQuery(CosmosQueryMethod method, CosmosOperations operations)Initialization
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract CosmosQuerycreateQuery(CosmosParameterAccessor accessor)Creates a query.Objectexecute(Object[] parameters)Executes theAbstractCosmosQuerywith the given parameters.protected CosmosQueryExecutiongetExecution(CosmosParameterAccessor accessor, org.springframework.data.repository.query.ReturnedType returnedType)Determines the appropriate execution path for a queryCosmosQueryMethodgetQueryMethod()Get method of queryprotected booleanisCollectionQuery()protected abstract booleanisCountQuery()protected abstract booleanisDeleteQuery()protected abstract booleanisExistsQuery()protected booleanisPageQuery()protected booleanisSliceQuery()
-
-
-
Field Detail
-
operations
protected final CosmosOperations operations
CosmosOperations
-
-
Constructor Detail
-
AbstractCosmosQuery
public AbstractCosmosQuery(CosmosQueryMethod method, CosmosOperations operations)
Initialization- Parameters:
method- CosmosQueryMethodoperations- CosmosOperations
-
-
Method Detail
-
execute
public Object execute(Object[] parameters)
Executes theAbstractCosmosQuerywith the given parameters.- Specified by:
executein interfaceorg.springframework.data.repository.query.RepositoryQuery- Parameters:
parameters- must not be null.- Returns:
- execution result. Can be null.
-
getExecution
protected CosmosQueryExecution getExecution(CosmosParameterAccessor accessor, org.springframework.data.repository.query.ReturnedType returnedType)
Determines the appropriate execution path for a query- Parameters:
returnedType- The return type of the methodaccessor- Object for accessing method parameters- Returns:
- the execution type needed to handle the query
-
getQueryMethod
public CosmosQueryMethod getQueryMethod()
Get method of query- Specified by:
getQueryMethodin interfaceorg.springframework.data.repository.query.RepositoryQuery- Returns:
- CosmosQueryMethod
-
createQuery
protected abstract CosmosQuery createQuery(CosmosParameterAccessor accessor)
Creates a query.- Parameters:
accessor- Cosmos parameter accessor.- Returns:
- a Cosmos query.
-
isDeleteQuery
protected abstract boolean isDeleteQuery()
- Returns:
- whether this is a deletion query.
-
isExistsQuery
protected abstract boolean isExistsQuery()
- Returns:
- whether this is an exists query.
-
isCountQuery
protected abstract boolean isCountQuery()
- Returns:
- whether this is a count query.
-
isPageQuery
protected boolean isPageQuery()
- Returns:
- whether this is a page query.
-
isCollectionQuery
protected boolean isCollectionQuery()
- Returns:
- whether this is a collection query.
-
isSliceQuery
protected boolean isSliceQuery()
- Returns:
- whether this is a slice query.
-
-