1

I have the following code which uses Specification to build complex where clause.


public interface EmployeeRepository extends
    CrudRepository<Employee, String>,
    JpaSpecificationExecutor<Employee> {
}

public class Service {
    @Autowired
    private EmployeeRepository employeeRepository;


   public List<Employee> test() {
      return employeeRepository.findAll(where(hasNames(List.of("Tom", "Jerry"))).and(hasAges(List.of(20,21))));
   }
}

I'm trying to convert this code to reactive using the r2dbc. I replaced CrudRepository with ReactiveCrudRepository. However in order to build the complex where clause I need to use Specification. I don't see a reactive version of JpaSpecificationExecutor

public interface EmployeeRepository extends
    ReactiveCrudRepository<Employee, String>,
    JpaSpecificationExecutor<Employee> { // is there ReactiveJpaSpecificationExecutor?
}

Is there a reactive version of JpaSpecificationExecutor, or a way to build such where clause in reactive?

user3908406
  • 1,416
  • 1
  • 18
  • 32

1 Answers1

0

I also waiting for Criteria, but I didn't see now ;-) I need to implement beetwen: Spring JPA ExampleMatcher compare date condition

See also similar questions: https://github.com/spring-projects/spring-data-jpa/issues/1331 https://github.com/r2dbc/r2dbc-spi/issues/141

Maybe you can use Template at the moment: https://hantsy.medium.com/update-accessing-rdbms-with-spring-data-r2dbc-a4d118b1669d or infobip-spring-data-querydsl