Cosium / spring-data-jpa-entity-graph

Spring Data JPA extension allowing full dynamic usage of EntityGraph on repositories
MIT License
469 stars 52 forks source link

Allow usage of smallest repository interfaces #7

Closed marceloverdijk closed 7 years ago

marceloverdijk commented 7 years ago

Spring Data JPA 1.11.x includes a QueryByExampleExecutor (part of Spring Data Commons >=1.12).

It would be nice to have a JpaEntityGraphQueryByExampleExecutor to support providing the entity graph.

reda-alaoui commented 7 years ago

Good idea indeed.

Could you make a PR for this?

marceloverdijk commented 7 years ago

Hi @reda-alaoui I'm not requiring this JpaEntityGraphQueryByExampleExecutor currently but I think this might be useful to be included in the lib.

reda-alaoui commented 7 years ago

Ok no problem

reda-alaoui commented 7 years ago

In fact, JpaEntityGraphRepository is already a QueryByExampleExecutor.

image

And all QueryByExampleExecutor methods completed with EntityGraphs are available in JpaEntityGraphRepository.

Maybe you want a repository interface that would only expose QueryByExampleExecutor methods?

More globally, I think that a good enhancement would be to split JpaEntityGraphRepository into new EntityGraph repositories for:

This would let people take the smallest needed interface, like you did with org.springframework.data.repository.Repository.

marceloverdijk commented 7 years ago

Well done!