posted 8 years ago
Hi Guys
Im doing a LEFT JOIN FETCH in a named query. Result data is as expected. In some cases, parent records wont exist as a foriegn key on the child table. For each parent that doesnt exist on child table JPA does an additional select for this manytoone unidirectional mapping
For parent table where a parent ID does not exist in child row, then JPA does an additional select
How can I stop this additional select. If my search criteria brings back parent rows that all exist as a foreign key on the child table, the additional selects does not happen. If I have 5 parents rows out of result list of 10 that don't exist on child table as a foreign key I will have 5 additional selects.