org.springframework.data.repository.reactive

## Interface ReactiveCrudRepository<T,ID>

All Superinterfaces:
  Repository<T,ID>

All Known Subinterfaces:
  ReactiveSortingRepository<T,ID>

    @NoRepositoryBean
    public interface ReactiveCrudRepository<T,ID>
    extends Repository<T,ID>

Interface for generic CRUD operations on a repository for a specific type. This repository follows reactive paradigms and uses Project Reactor types which are built on top of Reactive Streams.

Since:
  2.0
Author:
  Mark Paluch, Christph Strobl
See Also:
  `Mono`, `Flux`

### Method Summary

All Methods Instance Methods Abstract Methods
`reactor.core.publisher.Mono<Long>` `count()` Returns the number of entities available.
`reactor.core.publisher.Mono<Void>` `delete(T entity)` Deletes a given entity.
`reactor.core.publisher.Mono<Void>` `deleteAll()` Deletes all entities managed by the repository.
`reactor.core.publisher.Mono<Void>` `deleteAll(Iterable<? extends T> entities)` Deletes the given entities.
`reactor.core.publisher.Mono<Void>` `deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)` Deletes the given entities supplied by a `Publisher`.
`reactor.core.publisher.Mono<Void>` `deleteById(ID id)` Deletes the entity with the given id.
`reactor.core.publisher.Mono<Void>` `deleteById(org.reactivestreams.Publisher<ID> id)` Deletes the entity with the given id supplied by a `Publisher`.
`reactor.core.publisher.Mono<Boolean>` `existsById(ID id)` Returns whether an entity with the given id exists.
`reactor.core.publisher.Mono<Boolean>` `existsById(org.reactivestreams.Publisher<ID> id)` Returns whether an entity with the given id, supplied by a `Publisher`, exists.
`reactor.core.publisher.Flux<T>` `findAll()` Returns all instances of the type.
`reactor.core.publisher.Flux<T>` `findAllById(Iterable<ID> ids)` Returns all instances of the type `T` with the given IDs.
`reactor.core.publisher.Flux<T>` `findAllById(org.reactivestreams.Publisher<ID> idStream)` Returns all instances of the type `T` with the given IDs supplied by a `Publisher`.
`reactor.core.publisher.Mono<T>` `findById(ID id)` Retrieves an entity by its id.
`reactor.core.publisher.Mono<T>` `findById(org.reactivestreams.Publisher<ID> id)` Retrieves an entity by its id supplied by a `Publisher`.
`<S extends T> reactor.core.publisher.Mono<S>` `save(S entity)` Saves a given entity.
`<S extends T> reactor.core.publisher.Flux<S>` `saveAll(Iterable<S> entities)` Saves all given entities.
`<S extends T> reactor.core.publisher.Flux<S>` `saveAll(org.reactivestreams.Publisher<S> entityStream)` Saves all given entities.

### Method Detail

#### save

    <S extends T> reactor.core.publisher.Mono<S> save(S entity)

Saves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.

Parameters:
  `entity` - must not be null.
Returns:
  `Mono` emitting the saved entity.
Throws:
  `IllegalArgumentException` - in case the given entity is null.

#### saveAll

    <S extends T> reactor.core.publisher.Flux<S> saveAll(Iterable<S> entities)

Saves all given entities.

Parameters:
  `entities` - must not be null.
Returns:
  `Flux` emitting the saved entities.
Throws:
  `IllegalArgumentException` - in case the given `entities` or one of its entities is null.

#### saveAll

    <S extends T> reactor.core.publisher.Flux<S> saveAll(org.reactivestreams.Publisher<S> entityStream)

Saves all given entities.

Parameters:
  `entityStream` - must not be null.
Returns:
  `Flux` emitting the saved entities.
Throws:
  `IllegalArgumentException` - in case the given `entityStream` is null.

#### findById

    reactor.core.publisher.Mono<T> findById(ID id)

Retrieves an entity by its id.

Parameters:
  `id` - must not be null.
Returns:
  `Mono` emitting the entity with the given id or `Mono.empty()` if none found.
Throws:
  `IllegalArgumentException` - in case the given id is null.

#### findById

    reactor.core.publisher.Mono<T> findById(org.reactivestreams.Publisher<ID> id)

Retrieves an entity by its id supplied by a `Publisher`.

Parameters:
  `id` - must not be null. Uses the first emitted element to perform the find-query.
Returns:
  `Mono` emitting the entity with the given id or `Mono.empty()` if none found.
Throws:
  `IllegalArgumentException` - in case the given `id` is null.

#### existsById

    reactor.core.publisher.Mono<Boolean> existsById(ID id)

Returns whether an entity with the given id exists.

Parameters:
  `id` - must not be null.
Returns:
  `Mono` emitting true if an entity with the given id exists, false otherwise.
Throws:
  `IllegalArgumentException` - in case the given id is null.

#### existsById

    reactor.core.publisher.Mono<Boolean> existsById(org.reactivestreams.Publisher<ID> id)

Returns whether an entity with the given id, supplied by a `Publisher`, exists. Uses the first emitted element to perform the exists-query.

Parameters:
  `id` - must not be null.
Returns:
  `Mono` emitting true if an entity with the given id exists, false otherwise.
Throws:
  `IllegalArgumentException` - in case the given `id` is null.

#### findAll

    reactor.core.publisher.Flux<T> findAll()

Returns all instances of the type.

Returns:
  `Flux` emitting all entities.

#### findAllById

    reactor.core.publisher.Flux<T> findAllById(Iterable<ID> ids)

Returns all instances of the type `T` with the given IDs.

If some or all ids are not found, no entities are returned for these IDs.

Note that the order of elements in the result is not guaranteed.

Parameters:
  `ids` - must not be null nor contain any null values.
Returns:
  `Flux` emitting the found entities. The size can be equal or less than the number of given ids.
Throws:
  `IllegalArgumentException` - in case the given `ids` or one of its items is null.

#### findAllById

    reactor.core.publisher.Flux<T> findAllById(org.reactivestreams.Publisher<ID> idStream)

Returns all instances of the type `T` with the given IDs supplied by a `Publisher`.

If some or all ids are not found, no entities are returned for these IDs.

Note that the order of elements in the result is not guaranteed.

Parameters:
  `idStream` - must not be null.
Returns:
  `Flux` emitting the found entities.
Throws:
  `IllegalArgumentException` - in case the given `idStream` is null.

#### count

    reactor.core.publisher.Mono<Long> count()

Returns the number of entities available.

Returns:
  `Mono` emitting the number of entities.

#### deleteById

    reactor.core.publisher.Mono<Void> deleteById(ID id)

Deletes the entity with the given id.

Parameters:
  `id` - must not be null.
Returns:
  `Mono` signaling when operation has completed.
Throws:
  `IllegalArgumentException` - in case the given id is null.

#### deleteById

    reactor.core.publisher.Mono<Void> deleteById(org.reactivestreams.Publisher<ID> id)

Deletes the entity with the given id supplied by a `Publisher`.

Parameters:
  `id` - must not be null.
Returns:
  `Mono` signaling when operation has completed.
Throws:
  `IllegalArgumentException` - in case the given `id` is null.

#### delete

    reactor.core.publisher.Mono<Void> delete(T entity)

Deletes a given entity.

Parameters:
  `entity` - must not be null.
Returns:
  `Mono` signaling when operation has completed.
Throws:
  `IllegalArgumentException` - in case the given entity is null.

#### deleteAll

    reactor.core.publisher.Mono<Void> deleteAll(Iterable<? extends T> entities)

Deletes the given entities.

Parameters:
  `entities` - must not be null.
Returns:
  `Mono` signaling when operation has completed.
Throws:
  `IllegalArgumentException` - in case the given `entities` or one of its entities is null.

#### deleteAll

    reactor.core.publisher.Mono<Void> deleteAll(org.reactivestreams.Publisher<? extends T> entityStream)

Deletes the given entities supplied by a `Publisher`.

Parameters:
  `entityStream` - must not be null.
Returns:
  `Mono` signaling when operation has completed.
Throws:
  `IllegalArgumentException` - in case the given `entityStream` is null.

#### deleteAll

    reactor.core.publisher.Mono<Void> deleteAll()

Deletes all entities managed by the repository.

Returns:
  `Mono` signaling when operation has completed.