I have a jpql query to look forward to getting multi-level associations as follows
select distinct s from Singer s left join fetch s.singerIdentifiers si //singerIdentifiers is collection in Singer object left join fetch si.identifier i left join fetch i.identifierReportedAreas ira left join fetch irc.reportedArea ra left join fetch rc.reportingSystem rs where s.id in (?);
This generates multiple queries, although I get all the necessary information in the first choice. All additional queries are designed to query the SingerIdentifier table data for individual identifiers from the first query.
Any help in this regard is much appreciated.
source share