[jboss-user] [EJB 3.0] - Re: Properly using a OneToMany relationship using EJB 3.0

itsme do-not-reply at jboss.com
Mon Jun 18 03:10:31 EDT 2007


Hi,

you two different options:

First one is to changed the loading strategy of your relationship by adding the appropriate attributes to the annotation i.e.
@OneToMany(fetch = FetchType.EAGER).
This is a standard declaration defined by the spec.

Second one is a little bit tricky because of the knowledge of cursor going to be closed. A lazy fetched relationship can be fully loaded by iterating over the collection using an iterator of an attached entity. Thus it is enough to call the relationships iterator method and the assoziated entities must be loaded.

Regards

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055100



More information about the jboss-user mailing list