-->
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.  [ 3 posts ] 
Author Message
 Post subject: Filters with Lazy Load associations
PostPosted: Tue Jan 10, 2006 11:05 pm 
Newbie

Joined: Mon Oct 10, 2005 7:24 pm
Posts: 4
Hi,
I am using Hibernate 3.1 and Spring. I have a hibernate filter which need to be applied on all the associations. As the model objects are lazy loaded in view (using OpenSessionInView filter), how to apply filters on this ? I can programatically enable filter before accessing association, is it how every one does or there is a better way to do it ? This way my view classes will clutter with filter enabling code. Am I missing something basic here ?
Thanks,
Ashish


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 11, 2006 4:45 am 
Senior
Senior

Joined: Tue Aug 23, 2005 8:52 am
Posts: 181
If you need filters applied to a collection everytime you reference it, you can add the "filter" attribute to your mapping file.


Top
 Profile  
 
 Post subject: Enabling filter is required even if specified in mapping fil
PostPosted: Wed Jan 11, 2006 1:21 pm 
Newbie

Joined: Mon Oct 10, 2005 7:24 pm
Posts: 4
I have applied filters in my mapping file but as per my understanding filters need to be enabled in current session. Just applying filter in mapping does not work unless it is enabled in current session.
This is also because while enabling the filter I need to set run time parameter to it.


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

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.