SimpleCosmosRepository<T,ID> Class
- java.
lang. Object - com.
azure. spring. data. cosmos. repository. support. SimpleCosmosRepository<T,ID>
- com.
Type Parameters
- T
domain type.
- ID
id type.
Implements
public class SimpleCosmosRepository<T,ID>
implements CosmosRepository<T,ID>
Repository class for simple Cosmos operation
Constructor Summary
Constructor | Description |
---|---|
SimpleCosmosRepository(CosmosEntityInformation<T,ID> metadata, CosmosOperations dbOperations) |
Initialization |
Method Summary
Modifier and Type | Method and Description |
---|---|
S |
save(ID id, PartitionKey partitionKey, Class<S> domainType, CosmosPatchOperations patchOperations)
patch entity with Cosmos |
S |
save(ID id, PartitionKey partitionKey, Class<S> domainType, CosmosPatchOperations patchOperations, CosmosPatchItemRequestOptions options)
patch entity with Cosmos |
S |
save(S entity)
save entity without partition |
Iterable<S> |
saveAll(Iterable<S> entities)
Batch save entities. |
long |
count()
return count of documents in one container without partitions |
void |
delete(T entity)
delete one document per entity |
void |
deleteAll()
Delete all the domains of a container. |
void |
deleteAll(Iterable<? extends T> entities)
Delete list of entities without partitions. |
void | deleteAllById(Iterable<? extends ID> ids) |
void |
deleteById(ID id)
delete one document per id without configuring partition key value |
void |
deleteById(ID id, PartitionKey partitionKey)
Deletes an entity by its id and partition key. |
boolean |
existsById(ID primaryKey)
check if an entity exists per id without partition |
Iterable<T> |
findAll()
find all entities from one container without configuring partition key value |
Iterable<T> |
findAll(PartitionKey partitionKey)
Returns list of items in a specific partition |
org.springframework.data.domain.Page<T> |
findAll(Pageable pageable)
Find |
Iterable<T> |
findAll(Sort sort)
Returns all entities sorted by the given options. |
Iterable<T> |
findAllById(Iterable<ID> ids)
find entities based on id list from one container without partitions |
Optional<T> |
findById(ID id)
find one entity per id without partitions |
Optional<T> |
findById(ID id, PartitionKey partitionKey)
Retrieves an entity by its id. |
Methods inherited from java.lang.Object
Constructor Details
SimpleCosmosRepository
public SimpleCosmosRepository(CosmosEntityInformation
Initialization
Parameters:
Method Details
save
public S save(ID id, PartitionKey partitionKey, Class domainType, CosmosPatchOperations patchOperations)
patch entity with CosmosPatchItemRequestOptions
Parameters:
save
public S save(ID id, PartitionKey partitionKey, Class domainType, CosmosPatchOperations patchOperations, CosmosPatchItemRequestOptions options)
patch entity with CosmosPatchItemRequestOptions
Parameters:
save
public S save(S entity)
save entity without partition
Parameters:
Returns:
saveAll
public Iterable saveAll(Iterable entities)
Batch save entities. Uses bulk if possible.
Parameters:
Returns:
count
public long count()
return count of documents in one container without partitions
Returns:
delete
public void delete(T entity)
delete one document per entity
Parameters:
deleteAll
public void deleteAll()
Delete all the domains of a container. Uses bulk if possible.
deleteAll
public void deleteAll(Iterable entities)
Delete list of entities without partitions. Uses bulk if possible.
Parameters:
deleteAllById
public void deleteAllById(Iterable ids)
Parameters:
deleteById
public void deleteById(ID id)
delete one document per id without configuring partition key value
Parameters:
deleteById
public void deleteById(ID id, PartitionKey partitionKey)
Deletes an entity by its id and partition key.
Parameters:
existsById
public boolean existsById(ID primaryKey)
check if an entity exists per id without partition
Parameters:
Returns:
findAll
public Iterable
find all entities from one container without configuring partition key value
Returns:
findAll
public Iterable
Returns list of items in a specific partition
Parameters:
findAll
public Page
FindQuerySpecGenerator Returns a Page of entities meeting the paging restriction provided in the Pageable object.
Parameters:
Returns:
findAll
public Iterable
Returns all entities sorted by the given options.
Parameters:
Returns:
findAllById
public Iterable
find entities based on id list from one container without partitions
Parameters:
Returns:
findById
public Optional
find one entity per id without partitions
Parameters:
Returns:
findById
public Optional
Retrieves an entity by its id.
Parameters:
Applies to
Azure SDK for Java