Skip to content

Add support for basic operations on Repository interface #371

Description

@gabrieldn

It would be useful if the library provided basic operations like count, exists, delete, findOne and findAll given a criteria, sort or pageable. The interface could look something like this:

public interface R2dbcRepository<T, ID> extends ReactiveCrudRepository<T, ID> {
    Mono<Long> count(Criteria criteria);

    Mono<Boolean> exists(Criteria criteria);

    Mono<Void> delete(Criteria criteria);

    Mono<T> findOne(Criteria criteria);

    Flux<T> findAll(Criteria criteria);

    Flux<T> findAll(Sort sort);

    Flux<T> findAll(Criteria criteria, Sort sort);

    Mono<Page<T>> findAll(Pageable pageable);

    Mono<Page<T>> findAll(Criteria criteria, Pageable pageable);
}

There is support for this kind of methods on spring-data-jpa. It would be cool if r2dbc also supported it. The implementation should be pretty straight forward using the api available on R2dbcEntityOperations, which is already available on the SimpleR2dbcRepository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions