public interface CosmosOperations
| Modifier and Type | Method and Description |
|---|---|
<T> long |
count(CosmosQuery query,
String containerName)
Count
|
<T> long |
count(SqlQuerySpec querySpec,
String containerName)
Count
|
long |
count(String containerName)
Count
|
CosmosContainerProperties |
createContainerIfNotExists(CosmosEntityInformation<?,?> information)
Creates container if not exists
|
<T> Iterable<T> |
delete(CosmosQuery query,
Class<T> domainType,
String containerName)
Delete items matching query
|
void |
deleteAll(String containerName,
Class<?> domainType)
Delete all items in a container
|
void |
deleteById(String containerName,
Object id,
PartitionKey partitionKey)
Delete an item by id
|
void |
deleteContainer(String containerName)
Delete container
|
<T> void |
deleteEntity(String containerName,
T entity)
Delete using entity
|
<T> Boolean |
exists(CosmosQuery query,
Class<T> domainType,
String containerName)
Exists
|
<T> Iterable<T> |
find(CosmosQuery query,
Class<T> domainType,
String containerName)
Find query
|
<T> Iterable<T> |
findAll(Class<T> domainType)
Find the DocumentQuery, find all the items specified by domain type.
|
<T> org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable,
Class<T> domainType,
String containerName)
Find all items in a given container with partition key
|
<T> Iterable<T> |
findAll(PartitionKey partitionKey,
Class<T> domainType)
Find the DocumentQuery, find all the items specified by domain type in the given container.
|
<T> Iterable<T> |
findAll(String containerName,
Class<T> domainType)
Find the DocumentQuery, find all the items specified by domain type in the given container.
|
<T> T |
findById(Object id,
Class<T> domainType)
Finds item by id
|
<T> T |
findById(Object id,
Class<T> domainType,
PartitionKey partitionKey)
Finds item by id
|
<T> T |
findById(String containerName,
Object id,
Class<T> domainType)
Finds item by id
|
<T,ID> Iterable<T> |
findByIds(Iterable<ID> ids,
Class<T> domainType,
String containerName)
Find by ids
|
String |
getContainerName(Class<?> domainType)
To get container name by domainType
|
CosmosContainerProperties |
getContainerProperties(String containerName)
Get properties for specified container
|
MappingCosmosConverter |
getConverter()
To get converter
|
<T> T |
insert(String containerName,
T objectToSave)
Inserts item
|
<T> T |
insert(String containerName,
T objectToSave,
PartitionKey partitionKey)
Inserts item
|
<T> T |
insert(T objectToSave,
PartitionKey partitionKey)
Inserts item
|
<T> org.springframework.data.domain.Page<T> |
paginationQuery(CosmosQuery query,
Class<T> domainType,
String containerName)
Pagination query
|
CosmosContainerProperties |
replaceContainerProperties(String containerName,
CosmosContainerProperties properties)
Replace container properties for the specified container
|
<T> org.springframework.data.domain.Page<T> |
runPaginationQuery(SqlQuerySpec querySpec,
org.springframework.data.domain.Pageable pageable,
Class<?> domainType,
Class<T> returnType)
Run the query.
|
<T> Iterable<T> |
runQuery(SqlQuerySpec querySpec,
Class<?> domainType,
Class<T> returnType)
Run the query.
|
<T> Iterable<T> |
runQuery(SqlQuerySpec querySpec,
org.springframework.data.domain.Sort sort,
Class<?> domainType,
Class<T> returnType)
Run the query.
|
<T> org.springframework.data.domain.Slice<T> |
runSliceQuery(SqlQuerySpec querySpec,
org.springframework.data.domain.Pageable pageable,
Class<?> domainType,
Class<T> returnType)
Run custom SQL query
|
<T> org.springframework.data.domain.Slice<T> |
sliceQuery(CosmosQuery query,
Class<T> domainType,
String containerName)
Slice query
|
<T> void |
upsert(String containerName,
T object)
Upserts an item into container with partition key
|
<T> void |
upsert(T object)
Upserts an item with partition key
|
<T> T |
upsertAndReturnEntity(String containerName,
T object)
Upserts an item and return item properties
|
String getContainerName(Class<?> domainType)
domainType - class typeCosmosContainerProperties createContainerIfNotExists(CosmosEntityInformation<?,?> information)
information - CosmosEntityInformationCosmosContainerProperties getContainerProperties(String containerName)
containerName - StringCosmosContainerProperties replaceContainerProperties(String containerName, CosmosContainerProperties properties)
containerName - Stringproperties - CosmosContainerProperties<T> Iterable<T> findAll(Class<T> domainType)
T - class type of domaindomainType - the domain type<T> Iterable<T> findAll(String containerName, Class<T> domainType)
T - class type of domaincontainerName - the container namedomainType - the domain type<T> Iterable<T> findAll(PartitionKey partitionKey, Class<T> domainType)
T - class type of domainpartitionKey - the partition keydomainType - the domain type<T> T findById(Object id, Class<T> domainType)
T - type class of domain typeid - must not be nulldomainType - must not be null<T> T findById(String containerName, Object id, Class<T> domainType)
T - type class of domain typecontainerName - must not be nullid - must not be nulldomainType - must not be null<T> T findById(Object id, Class<T> domainType, PartitionKey partitionKey)
T - type class of domain typeid - must not be nulldomainType - must not be nullpartitionKey - must not be null<T> T insert(T objectToSave,
PartitionKey partitionKey)
T - type class of domain typeobjectToSave - must not be nullpartitionKey - must not be null<T> T insert(String containerName, T objectToSave, PartitionKey partitionKey)
T - type class of domain typecontainerName - must not be nullobjectToSave - must not be nullpartitionKey - must not be null<T> T insert(String containerName, T objectToSave)
T - type class of domain typecontainerName - must not be nullobjectToSave - must not be null<T> void upsert(T object)
T - type of upsert objectobject - upsert object<T> void upsert(String containerName, T object)
T - type of upsert objectcontainerName - the container nameobject - upsert object<T> T upsertAndReturnEntity(String containerName, T object)
T - type of upsert objectcontainerName - the container nameobject - upsert objectvoid deleteById(String containerName, Object id, PartitionKey partitionKey)
containerName - the container nameid - the idpartitionKey - the partition key<T> void deleteEntity(String containerName, T entity)
T - type class of domain typecontainerName - the container nameentity - the entity objectvoid deleteAll(String containerName, Class<?> domainType)
containerName - the container namedomainType - the domainTypevoid deleteContainer(String containerName)
containerName - the container name<T> Iterable<T> delete(CosmosQuery query, Class<T> domainType, String containerName)
T - type class of domainTypequery - the document querydomainType - type classcontainerName - the container name<T> Iterable<T> find(CosmosQuery query, Class<T> domainType, String containerName)
T - type class of domainTypequery - the document querydomainType - type classcontainerName - the container name<T,ID> Iterable<T> findByIds(Iterable<ID> ids, Class<T> domainType, String containerName)
T - type of domainTypeID - type of IDids - iterable of idsdomainType - type classcontainerName - the container name<T> Boolean exists(CosmosQuery query, Class<T> domainType, String containerName)
T - type of domainTypequery - the document querydomainType - type classcontainerName - the container name<T> org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable,
Class<T> domainType,
String containerName)
T - type of domainTypepageable - Pageable objectdomainType - the domainTypecontainerName - the container name<T> org.springframework.data.domain.Page<T> paginationQuery(CosmosQuery query, Class<T> domainType, String containerName)
T - type class of domainTypequery - the document querydomainType - type classcontainerName - the container name<T> org.springframework.data.domain.Slice<T> sliceQuery(CosmosQuery query, Class<T> domainType, String containerName)
T - type class of domainTypequery - the document querydomainType - type classcontainerName - the container name<T> org.springframework.data.domain.Slice<T> runSliceQuery(SqlQuerySpec querySpec, org.springframework.data.domain.Pageable pageable, Class<?> domainType, Class<T> returnType)
T - the type parameterquerySpec - the query specpageable - the pageabledomainType - the domain typereturnType - the return typelong count(String containerName)
containerName - the container name<T> long count(CosmosQuery query, String containerName)
T - type class of domainTypequery - the document querycontainerName - the container name<T> long count(SqlQuerySpec querySpec, String containerName)
T - type class of domainTypequerySpec - the document query speccontainerName - the container nameMappingCosmosConverter getConverter()
<T> Iterable<T> runQuery(SqlQuerySpec querySpec, Class<?> domainType, Class<T> returnType)
T - the type parameterquerySpec - the query specdomainType - the domain typereturnType - the return type<T> Iterable<T> runQuery(SqlQuerySpec querySpec, org.springframework.data.domain.Sort sort, Class<?> domainType, Class<T> returnType)
T - the type parameterquerySpec - the query specsort - the sort orderdomainType - the domain typereturnType - the return type<T> org.springframework.data.domain.Page<T> runPaginationQuery(SqlQuerySpec querySpec, org.springframework.data.domain.Pageable pageable, Class<?> domainType, Class<T> returnType)
T - the type parameterquerySpec - the query specpageable - the pageabledomainType - the domain typereturnType - the return typeVisit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.