Hibernate Performance
Instead of
SELECT a ...
use
SELECT DISTINCT a INNER JOIN FETCH a.rels ...
Then each iteration over as will not hit the DB.
for( A a : as ) { for( Rel r : a.getRels() ) { ... } }
Instead of
SELECT a ...
use
SELECT DISTINCT a INNER JOIN FETCH a.rels ...
Then each iteration over as will not hit the DB.
for( A a : as ) { for( Rel r : a.getRels() ) { ... } }