-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: @ManyToMany and eager fetching
PostPosted: Wed Apr 12, 2006 10:06 pm 
Beginner
Beginner

Joined: Sat Sep 17, 2005 10:41 am
Posts: 49
Hi,

I have a common problem here that I'm sure alot of people have seen. An Account entity with @ManyToMany relationship with Role. I marked the relationship to fetch as EAGER, as I typically would load the Account object and put it in the HttpSession. This would prevent a lazy fetch exception when I access Role sometime later in a different request.

The problem is when I use the criteria API to list all Accounts (say on an admin CRUD page), I get the Cartesian product of Account/Role. This can be fixed by using the DISTINCT_ROOT_ENTITY result transformer.

My question is, when using the distinct root entity transformer / criteria query on many-to-many relationships, does it eagerly fetch the relations for each of my distinct root entities?

Thanks[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.