You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not sure if this is a bug or a feature - I did not find any clarification on Stackoverflow or Baeldung and whatever Google brings up in the first 5 pages of results...
So I have some entity model where I am querying an entity with both a m:n and a n:1 relationship, and that one has another n:1 child.
Together a hibernate query results in a query for 100+ fields combined from that entities - of which I need just 8.
I was of the impression that @EntityGraph should hint hibernate which collections need to be eager loaded (that works) and the projection hints which fields should be queried?
I tried with type = EntityGraph.EntityGraphType.LOAD but it did not change the number of columns either.
Where does the problem sit now?
The text was updated successfully, but these errors were encountered:
SchlauFuchs
changed the title
I need some clarification on using a Repository function with projection interface, @Query and @EntityGraph
I need some clarification on using a Repository function with projection interface and @EntityGraph
Nov 22, 2022
Hi,
not sure if this is a bug or a feature - I did not find any clarification on Stackoverflow or Baeldung and whatever Google brings up in the first 5 pages of results...
So I have some entity model where I am querying an entity with both a m:n and a n:1 relationship, and that one has another n:1 child.
Together a hibernate query results in a query for 100+ fields combined from that entities - of which I need just 8.
This is my find method in the repository:
SkillWithConfigurationsProjection
is an interface following example on Baeldung - Spring Data JPA Projections:I was of the impression that
@EntityGraph
should hint hibernate which collections need to be eager loaded (that works) and the projection hints which fields should be queried?I tried with
type = EntityGraph.EntityGraphType.LOAD
but it did not change the number of columns either.Where does the problem sit now?
The text was updated successfully, but these errors were encountered: