public class SimpleCassandraRepository<T,ID> extends Object implements CassandraRepository<T,ID>
CassandraRepository| Constructor and Description |
|---|
SimpleCassandraRepository(CassandraEntityInformation<T,ID> metadata,
CassandraOperations operations)
Create a new
SimpleCassandraRepository for the given CassandraEntityInformation and
CassandraTemplate. |
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
void |
delete(T entity) |
void |
deleteAll() |
void |
deleteAll(Iterable<? extends T> entities) |
void |
deleteById(ID id) |
boolean |
existsById(ID id) |
List<T> |
findAll() |
Slice<T> |
findAll(Pageable pageable)
Returns a
Slice of entities meeting the paging restriction provided in the Pageable object. |
List<T> |
findAllById(Iterable<ID> ids)
Note: Cassandra supports single-field
IN queries only. |
Optional<T> |
findById(ID id) |
<S extends T> |
insert(Iterable<S> entities)
Inserts the given entities.
|
<S extends T> |
insert(S entity)
Inserts the given entity.
|
<S extends T> |
save(S entity) |
<S extends T> |
saveAll(Iterable<S> entities) |
public SimpleCassandraRepository(CassandraEntityInformation<T,ID> metadata, CassandraOperations operations)
SimpleCassandraRepository for the given CassandraEntityInformation and
CassandraTemplate.metadata - must not be null.operations - must not be null.public <S extends T> S save(S entity)
save in interface CrudRepository<T,ID>public <S extends T> List<S> saveAll(Iterable<S> entities)
saveAll in interface CassandraRepository<T,ID>saveAll in interface CrudRepository<T,ID>public <S extends T> S insert(S entity)
CassandraRepositoryCrudRepository.save(Object) instead to avoid the usage of store-specific API.insert in interface CassandraRepository<T,ID>entity - must not be null.public <S extends T> List<S> insert(Iterable<S> entities)
CassandraRepositoryCassandraRepository.saveAll(Iterable). Prefer using CassandraRepository.saveAll(Iterable) to avoid the usage of
store specific API.insert in interface CassandraRepository<T,ID>entities - must not be null.public Optional<T> findById(ID id)
findById in interface CrudRepository<T,ID>public boolean existsById(ID id)
existsById in interface CrudRepository<T,ID>public long count()
count in interface CrudRepository<T,ID>public List<T> findAll()
findAll in interface CassandraRepository<T,ID>findAll in interface CrudRepository<T,ID>public List<T> findAllById(Iterable<ID> ids)
CassandraRepositoryIN queries only. When using MapId with multiple components,
use CrudRepository.findById(Object).findAllById in interface CassandraRepository<T,ID>findAllById in interface CrudRepository<T,ID>public Slice<T> findAll(Pageable pageable)
CassandraRepositorySlice of entities meeting the paging restriction provided in the Pageable object.findAll in interface CassandraRepository<T,ID>pageable - must not be null.Slice of entities.CassandraPageRequestpublic void deleteById(ID id)
deleteById in interface CrudRepository<T,ID>public void delete(T entity)
delete in interface CrudRepository<T,ID>public void deleteAll(Iterable<? extends T> entities)
deleteAll in interface CrudRepository<T,ID>public void deleteAll()
deleteAll in interface CrudRepository<T,ID>Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.