Hello
I've one relation 1:n
Person 1------->N Address
Person (name, addresses(set))
Address (descripiption, value)
Now I want to take a List of Person that contains Address with 'value>50'
I do 4example:
form Person where addresses.value > '50'
The set is lazy false.
A Person is loaded from DB if it contains an Address with a value>50.
The problem is that the Set of Address contains all the Address associated to the Person! I want that the Person in the list contains a Set of only the Address with value>50 and not all the associated Address.
In this moment I take this list
LIST
-----Person ----- Address ("AAA", 55);
----- Address ("BBB", 10); (I don't want this)
-----Person ----- Address ("DDD", 144);
----- Address ("DDD", 442);
----- Address ("EEE", 4); (I don't want this)
I want a list like
LIST
-----Person ----- Address ("AAA", 55);
-----Person ----- Address ("DDD", 144);
----- Address ("DDD", 442);
What's the method to do this with Hibernate?
Thanks a lot
Martina