0

I am looking for the best way (or pro/con of different methods) to do a search with multiple dynamic criteria. It means that the number of search criteria might be different. I have found some method in spring:

  • MethodNameQuery (fixed number of criteria)
  • @Query(fixed number of criteria)
  • Specification
  • Querydsl
  • ExampleMatcher

Are there other options that I didn't list? Which one should I use in spring boot with spring data JPA? How to perform IN search with ExampleMatcher.

Thanks.

JasminDan
  • 523
  • 2
  • 6
  • 14
  • IMO QueryDsl is the right choice: https://stackoverflow.com/a/48596145 – Cepr0 Mar 21 '18 at 16:08
  • Possible duplicate of [Dynamic spring data jpa repository query with arbitrary AND clauses](https://stackoverflow.com/questions/28874135/dynamic-spring-data-jpa-repository-query-with-arbitrary-and-clauses) – Robert Niestroj Mar 21 '18 at 17:05

0 Answers0