Hi, I Have two entities with relations:
House and persons House have many person, I Need to bring a list of houses, fetching persons, but I want to bring only persons under 12.
@OneToMany(mappedBy = "house", cascade = CascadeType.REMOVE) private Set<Person> persons;
Example house 1 have 3 persons: 45, 17,7 House 2 have 4 persons: 55,56,8,3.
Yhe result i want Is:
house1 with a set of size 1 (person 17) house 2 with a set of size 2 (person 8 and 3)
Is it possible with a HQL clause??
Last edited by wiji on Wed Oct 06, 2010 3:16 am, edited 1 time in total.
|