Closed omar-f-nassar closed 5 years ago
Hi Omar,
As specified by JPA 2.1, EntityGraph only affects the fetch policy on associated entities. Thus affect only the load of foreign table columns. In your example, Person holds no association. So what you are seeing is normal.
Whatever you do, when you ask JPA to find Person, all person table columns will always be part of the generated query.
In a spring boot application with spring data jpa entity graph, I am extending the
EntityGraphCrudRepository
and also triedEntityGraphJpaRepository
, the generated query columns is not effected by the passed entity graph object (all the columns still returned).Kindly check the generated query in the comment block below in the sample application:
Dependencies:
application.yml: