3

I use R2DBC repository:

@Repository
public interface StockRepo extends ReactiveCrudRepository<Stock, Long> {
Flux<Stock> searchByArrayValueIgnoreCase(String[] arr);

}

I need to create custom query to postgres like "select * from stocks where title like any (array['%1%', '%2%', '%3%']);"

I send String[] arr in to repository;

in my repository:

@Query("select * from stocks where title like any WHAT") 
    Flux<Stock> searchByArrayValueIgnoreCase(String[] arr);

What I need to write instead of "WHAT" in query?

I tried @Query("select * from stocks where title like any (array[:#{#arr}])") but received error:

org.springframework.dao.InvalidDataAccessApiUsageException: No parameter specified for [__synthetic_0__]] in query [select * from stocks where title like any (array[:__synthetic_0__])]
Serg
  • 77
  • 1
  • 6

0 Answers0