Fixed
Details
Assignee
Vlad MihalceaVlad MihalceaReporter
Harsh PanchalHarsh PanchalComponents
Fix versions
Priority
Minor
Details
Details
Assignee
Vlad Mihalcea
Vlad MihalceaReporter
Harsh Panchal
Harsh PanchalComponents
Fix versions
Priority
Created March 14, 2017 at 4:07 AM
Updated April 14, 2017 at 10:13 AM
Resolved March 22, 2017 at 2:27 PM
I came to an unwanted behavior of Hibernate while retrieving many to many relationship by fetch graph hinted hql. Hibernate executed left outer join query to retrieve that entity and thus returned duplicate results (reason).
But my point is that there is a difference between user specifying Entity graph and manually executing HQL query with left joins.
When user is explicitly executing left outer join, he might be aware of possibility of duplication, but this is not the case with entity graph. User might be unaware of this & he may rely on size() operation to get the count. Besides, entity graph contract only tells about properties to be fetched, so it should not modify the result set (especially the count of returned entities)