I am trying lazy fetch JPA entities like described in How to load lazy fetched items from Hibernate/JPA in my controller That post in the example uses two classes - Person
and Role
and Person entity has associated roles.
I need to fetch roles for each person, but I need to fetch only some persons not all the persons. So - can I use @Query
and @EntityGraph
on the the same method of repository?