Compartilhar via


AbstractCosmosQuery Class

  • java.lang.Object
    • com.azure.spring.data.cosmos.repository.query.AbstractCosmosQuery

Implements

org.springframework.data.repository.query.RepositoryQuery

public abstract class AbstractCosmosQuery
implements org.springframework.data.repository.query.RepositoryQuery

Abstract class for cosmos query.

Field Summary

Modifier and Type Field and Description
protected final CosmosOperations operations

CosmosOperations

Constructor Summary

Constructor Description
AbstractCosmosQuery(CosmosQueryMethod method, CosmosOperations operations)

Initialization

Method Summary

Modifier and Type Method and Description
protected abstract CosmosQuery createQuery(CosmosParameterAccessor accessor)

Creates a query.

Object execute(Object[] parameters)

Executes the AbstractCosmosQuery with the given parameters.

protected CosmosQueryExecution getExecution(CosmosParameterAccessor accessor, ReturnedType returnedType)

Determines the appropriate execution path for a query

CosmosQueryMethod getQueryMethod()

Get method of query

protected boolean isCollectionQuery()
protected abstract boolean isCountQuery()
protected abstract boolean isDeleteQuery()
protected abstract boolean isExistsQuery()
protected boolean isPageQuery()
protected boolean isSliceQuery()

Methods inherited from java.lang.Object

Field Details

operations

protected final CosmosOperations operations

CosmosOperations

Constructor Details

AbstractCosmosQuery

public AbstractCosmosQuery(CosmosQueryMethod method, CosmosOperations operations)

Initialization

Parameters:

method - CosmosQueryMethod
operations - CosmosOperations

Method Details

createQuery

protected abstract CosmosQuery createQuery(CosmosParameterAccessor accessor)

Creates a query.

Parameters:

accessor - Cosmos parameter accessor.

Returns:

a Cosmos query.

execute

public Object execute(Object[] parameters)

Executes the AbstractCosmosQuery with the given parameters.

Parameters:

parameters - must not be null.

Returns:

execution result. Can be null.

getExecution

protected CosmosQueryExecution getExecution(CosmosParameterAccessor accessor, ReturnedType returnedType)

Determines the appropriate execution path for a query

Parameters:

accessor - Object for accessing method parameters
returnedType - The return type of the method

Returns:

the execution type needed to handle the query

getQueryMethod

public CosmosQueryMethod getQueryMethod()

Get method of query

Returns:

CosmosQueryMethod

isCollectionQuery

protected boolean isCollectionQuery()

Returns:

whether this is a collection query.

isCountQuery

protected abstract boolean isCountQuery()

Returns:

whether this is a count 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.

isPageQuery

protected boolean isPageQuery()

Returns:

whether this is a page query.

isSliceQuery

protected boolean isSliceQuery()

Returns:

whether this is a slice query.

Applies to