I have simple (H)SQL query:
SELECT f
FROM Factory f
LEFT JOIN FETCH f.products p
LEFT JOIN FETCH p.customers
WHERE f.id = (:id)
But result contains multiple duplicated products
objects.. How I can solve this problem?
Please note: customers
and products
is collections i.e. there one-to-many association between factory and product and between product and customer
.