Hi,

actually, the "to many" side should be automatically populated when you access 
it. So, there is no need to perform entity manager queries.

Depending on the fetchType of the relationship, different things might happen:
If fetchType is "EAGER", then the children will be loaded when the parent is 
loaded. In this case, the EntityManager will fire some join statement against 
the database to load parent and childs with one query.
If fetchType is "LAZY", then the first call to "parent.getChilds()" will 
trigger the child collection loading. This will only work if the parent entity 
is under EntityManager control.

Hope this helps a bit.

Wolfgang

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242194#4242194

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242194
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to