I have a java entity PullRequest
which has Comments
, Reviewers
, and Labels
associations. I'm using older version of hibernate 3.5.0-Final.
I have an API getPullRequests
which should return List<PullRequest>
.
How can I fetch PullRequests using join fetch so that I can get Comments, Reviewers and Labels in 3 join queries instead of using N+1 queries.
I tried using distinct join fetch like select distinct p from PullRequest join fetch p.Comments where p.id in (:prids)
It is throwing BLOB can't be used in select distinct.
How can I fetch all associations using join fetch so that it won't trigger N+1 queries.