-->
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: a question about using annotations to filter collections
PostPosted: Wed Apr 20, 2011 7:48 pm 
Newbie

Joined: Fri Mar 18, 2011 6:20 pm
Posts: 4
I have a Set defined within a class as follows:

Code:
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
@JoinColumn(name="category_id", nullable=false)
public Set<Ad> getAds()
{
     return ads;
}


I would like to filter the ad's that are loaded into the set when the startDate contained in the ad is greater than todays date.
I could define a filter and enable the filter to the session however the Set is automatically generated for me and there is no session for me to enable the filter. How can I filter this Set of ads by comparing the startDate contained in the Ad class to todays date?


Any Help would be greatly appreciated!


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.