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