Class SimpleReactiveCassandraRepository<T,ID>
java.lang.Object
org.springframework.data.cassandra.repository.support.SimpleReactiveCassandraRepository<T,ID>
- All Implemented Interfaces:
ReactiveCassandraRepository<T,
,ID> ReactiveCrudRepository<T,
,ID> Repository<T,
ID>
public class SimpleReactiveCassandraRepository<T,ID>
extends Object
implements ReactiveCassandraRepository<T,ID>
Reactive repository base implementation for Cassandra.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl, Jens Schauder
-
Constructor Summary
ConstructorDescriptionSimpleReactiveCassandraRepository
(CassandraEntityInformation<T, ID> metadata, ReactiveCassandraOperations operations) Create a newSimpleReactiveCassandraRepository
for the givenCassandraEntityInformation
andReactiveCassandraOperations
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Long>
count()
reactor.core.publisher.Mono<Void>
reactor.core.publisher.Mono<Void>
reactor.core.publisher.Mono<Void>
reactor.core.publisher.Mono<Void>
reactor.core.publisher.Mono<Void>
deleteAllById
(Iterable<? extends ID> ids) reactor.core.publisher.Mono<Void>
deleteById
(ID id) reactor.core.publisher.Mono<Void>
deleteById
(org.reactivestreams.Publisher<ID> publisher) reactor.core.publisher.Mono<Boolean>
existsById
(ID id) reactor.core.publisher.Mono<Boolean>
existsById
(org.reactivestreams.Publisher<ID> publisher) reactor.core.publisher.Flux<T>
findAll()
reactor.core.publisher.Flux<T>
findAllById
(Iterable<ID> ids) reactor.core.publisher.Flux<T>
findAllById
(org.reactivestreams.Publisher<ID> idStream) reactor.core.publisher.Mono<T>
reactor.core.publisher.Mono<T>
<S extends T>
reactor.core.publisher.Flux<S>Inserts the given entities.<S extends T>
reactor.core.publisher.Flux<S>insert
(org.reactivestreams.Publisher<S> entityStream) Inserts the given a given entities.<S extends T>
reactor.core.publisher.Mono<S>insert
(S entity) Inserts the given entity.<S extends T>
reactor.core.publisher.Mono<S>save
(S entity) <S extends T>
reactor.core.publisher.Flux<S><S extends T>
reactor.core.publisher.Flux<S>saveAll
(org.reactivestreams.Publisher<S> entityStream)
-
Constructor Details
-
SimpleReactiveCassandraRepository
public SimpleReactiveCassandraRepository(CassandraEntityInformation<T, ID> metadata, ReactiveCassandraOperations operations) Create a newSimpleReactiveCassandraRepository
for the givenCassandraEntityInformation
andReactiveCassandraOperations
.- Parameters:
metadata
- must not be null.operations
- must not be null.
-
-
Method Details
-
save
- Specified by:
save
in interfaceReactiveCrudRepository<T,
ID>
-
saveAll
- Specified by:
saveAll
in interfaceReactiveCrudRepository<T,
ID>
-
saveAll
public <S extends T> reactor.core.publisher.Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream) - Specified by:
saveAll
in interfaceReactiveCrudRepository<T,
ID>
-
findById
- Specified by:
findById
in interfaceReactiveCrudRepository<T,
ID>
-
findById
- Specified by:
findById
in interfaceReactiveCrudRepository<T,
ID>
-
existsById
- Specified by:
existsById
in interfaceReactiveCrudRepository<T,
ID>
-
existsById
- Specified by:
existsById
in interfaceReactiveCrudRepository<T,
ID>
-
findAll
- Specified by:
findAll
in interfaceReactiveCrudRepository<T,
ID>
-
findAllById
Description copied from interface:ReactiveCassandraRepository
Note: Cassandra supports single-field
IN
queries only. Fetches each row individually when usingMapId
with multiple components.- Specified by:
findAllById
in interfaceReactiveCassandraRepository<T,
ID> - Specified by:
findAllById
in interfaceReactiveCrudRepository<T,
ID>
-
findAllById
Description copied from interface:ReactiveCassandraRepository
Fetches each row individually.
- Specified by:
findAllById
in interfaceReactiveCassandraRepository<T,
ID> - Specified by:
findAllById
in interfaceReactiveCrudRepository<T,
ID>
-
count
- Specified by:
count
in interfaceReactiveCrudRepository<T,
ID>
-
deleteById
- Specified by:
deleteById
in interfaceReactiveCrudRepository<T,
ID>
-
deleteById
- Specified by:
deleteById
in interfaceReactiveCrudRepository<T,
ID>
-
delete
- Specified by:
delete
in interfaceReactiveCrudRepository<T,
ID>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceReactiveCrudRepository<T,
ID>
-
deleteAll
- Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID>
-
deleteAll
public reactor.core.publisher.Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream) - Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID>
-
deleteAll
- Specified by:
deleteAll
in interfaceReactiveCrudRepository<T,
ID>
-
insert
Description copied from interface:ReactiveCassandraRepository
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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in interfaceReactiveCassandraRepository<T,
ID> - Parameters:
entity
- must not be null.- Returns:
- the saved entity
-
insert
Description copied from interface:ReactiveCassandraRepository
Inserts the given entities. 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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in interfaceReactiveCassandraRepository<T,
ID> - Parameters:
entities
- must not be null.- Returns:
- the saved entity
-
insert
public <S extends T> reactor.core.publisher.Flux<S> insert(org.reactivestreams.Publisher<S> entityStream) Description copied from interface:ReactiveCassandraRepository
Inserts the given a given entities. 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 usingReactiveCrudRepository.save(Object)
instead to avoid the usage of store-specific API.- Specified by:
insert
in interfaceReactiveCassandraRepository<T,
ID> - Parameters:
entityStream
- must not be null.- Returns:
- the saved entity
-