-->
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: Need Help Optimizing Retreival
PostPosted: Sat May 07, 2005 7:21 pm 
Beginner
Beginner

Joined: Wed Apr 13, 2005 2:03 pm
Posts: 34
Hibernate 3.0
MySQL

Hi Folks,

I'm having a horrible time solving a particular N+1 problem and I was hoping somebody here might have some advice.

I have a class (User) that contains within it a set of Responsibilities.

Based upon various security requirements, not every User caa see every single one of his responsibilities. Thus User "Bob" might have responsibilities A, B, C but under his security context he's only supposed to see A and C.

I want to display a list of Users and have one of the columns be the set of (filtered) responsibilities.

Right now, I'm querying the Users (step 1), and then doing a subselect with a Filter to get the responsibilities for each row. A classic N+1 approach.

Can anyone suggest a way to eagerly fetch the responsibilities that would include the filter criteria?


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.