Simplified:
Class1 {
private Collection<Class2> items;
}
Class2 {
private String name;
}
Now I want to be able to retrieve all Class1 objects that have a Class2 object in items where name is like for example ‘abc’;
I think I have to use the elements() function in HQL, but not sure yet how to use the property values.
Any pointers are welcome!
No, you just need to make a join:
Read the Hibernate documentation on HQL, associations and joins.