-->
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: Best practice for filtering getter of collections
PostPosted: Wed Apr 18, 2007 3:34 am 
Newbie

Joined: Mon Apr 19, 2004 5:56 am
Posts: 9
Hello,

i would like to do be able to retrieve a subset of collection with two differents getter for a same collection in my pojo.
For example, is it possible to do the following ?
if no, what cani do to retrieve subset of data (write a dao method ?) ?

Code:
class MyPojo {

private Long id;
....
private Set mySet = new HashSet();


// and
@OneToMany ...
public List getMySet(){
    return mySet;
}

// and one with a where annotation
@OneToMany ....
@Where (clause="country=toto")
public List getMySetBySpecificCountry(){

   return mySet;
}


}

Thank you very much.


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.