Interface CassandraRepository<T,ID>
- All Superinterfaces:
CrudRepository<T,,ID> ListCrudRepository<T,,ID> Repository<T,ID>
- All Known Subinterfaces:
MapIdCassandraRepository<T>
- All Known Implementing Classes:
SimpleCassandraRepository
Cassandra-specific extension of the
CrudRepository interface that allows the specification of a type for the
identity of the @Table (or @Persistable) type.
Repositories based on CassandraRepository can define either a single primary key, use a primary key class or
a compound primary key without a primary key class. Types using a compound primary key without a primary key class
must use MapId to declare their key value.
- Author:
- Alex Shvid, Matthew T. Adams, Mark Paluch
- See Also:
-
Method Summary
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, saveAll
-
Method Details
-
findAllById
Note: Cassandra supports single-field
INqueries only. When usingMapIdwith multiple components, useCrudRepository.findById(Object).- Specified by:
findAllByIdin interfaceCrudRepository<T,ID> - Specified by:
findAllByIdin interfaceListCrudRepository<T,ID> - Throws:
InvalidDataAccessApiUsageException- thrown when usingMapIdwith multiple key components.
-
findAll
Returns aSliceof entities meeting the paging restriction provided in thePageableobject.- Parameters:
pageable- must not be null.- Returns:
- a
Sliceof entities. - Since:
- 2.0
- See Also:
-
insert
Inserts the given entity. Assumes the instance to be new to be able to apply insertion optimizations. Use the returned instance for further operations as the save operation might have changed the entity instance completely. Prefer usingCrudRepository.save(Object)instead to avoid the usage of store-specific API.- Parameters:
entity- must not be null.- Returns:
- the saved entity
- Since:
- 2.0
-
insert
Inserts the given entities. Assumes the given entities to have not been persisted yet and thus will optimize the insert over a call toListCrudRepository.saveAll(Iterable). Prefer usingListCrudRepository.saveAll(Iterable)to avoid the usage of store specific API.- Parameters:
entities- must not be null.- Returns:
- the saved entities
- Since:
- 2.0
-