-->
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.  [ 2 posts ] 
Author Message
 Post subject: Filter on join or value Object
PostPosted: Tue Jul 26, 2005 4:36 am 
Regular
Regular

Joined: Mon Jun 13, 2005 12:21 pm
Posts: 61
Location: Hannover
Hi,

I'm just checking the new Hibernate 3 filter feature and got question about complex filters.
I've got an Object MyObject containing a Map (Set or something else) ofvalue objects. Know I want to apply a filter based on the keys or values of this Map (or on a join if it doesn't work with a simple Map.

My object looks something likes this:
Code:
// This is Pseudocode
class MyObject {
    String name;
    Map   users
    MyObject (String name,Map users) {
         this.name= name;
         this.users = users;
    }
    static MyObject createSample() {
        Map myMap = new HashMap();
        myMap.put("joe","Some information aboutl joe");
        myMap.put("susan","Some information about susan");
        return new MyObject("sample",myMap);
   }
}


Applying a filter ob Object.name would be pretty straightforward but is there a way filtering for all instances of MyObject where the users Map contains "joe" as a key. I could also change Myobject in some way, but I'm looking for some kind of filtering on a one-to-many relationsship. Not filtering the collection but filtering the parent data.

Is this possible at all using Hibernate Filter?

Thx
Joerg

Hibernate version:3.05


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 26, 2005 7:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use a subselect in the filter condition.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.