Search code examples
design-patternsspring-dataspring-data-jpaquerydsl

Combine JpaRepository with QueryDslPredicateExecutor


Is there a good design pattern that allows a single interface to combine the methods of Spring Data and Query DSL so that the query dsl methods are declared in a separated class and all that without having to deal directly with the EntityManager. Thanks


Solution

  • The best design pattern that I found is this one : JpaRepository & Query DSL Combination

    It consist in two interfaces : the first one extends jpaRepository and the second interface, plus the implementation of this last one who extends QueryDslRepositorySupport.