[jboss-user] [EJB 3.0] - Re: Problem with FetchType.EAGER - multiple instances of an
do-not-reply at jboss.com
Fri Nov 24 09:07:31 EST 2006
It looks like this behavior isn't a bug (see quote from http://docs.jboss.org/ejb3/app-server/HibernateAnnotations/reference/en/html_single/index.html#d0e1046)
anonymous wrote : 22.214.171.124. Association fetching
| You have the ability to either eagerly or lazily fetch associated entities. The fetch parameter can be set to FetchType.LAZY or FetchType.EAGER. EAGER will try to use an outer join select to retrieve the associated object, while LAZY is the default and will only trigger a select when the associated object is accessed for the first time. EJBQL also has a fetch keyword that allows you to override laziness when doing a particular query. This is very useful to improve performance and is decided on a use case to use case basis.
It is very inconvenient though. I suppose there's no work around other than using LAZY Fetching.
However, should an outer join of a parent table to a sub-table using the parent's primary key result in duplicate records? I'll have to do this manually to see what's going on.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988410#3988410
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988410
More information about the jboss-user