Hibernate version: 3.2.0
I already posted this in the EJB Forum but didn't get answer. Hopefully, you can help me here (Also, if it is not possible). Sorry for the double post. Here we go:
Hi,
I would like to know, how to create a criteria including elements of a collection, eg:
Code:
@Entity
class DBUser {
private List<Long> _myElements;
[b]@CollectionOfElements[/b]
public List<Long> getMyElements(){
return _myElements;
}
}
I thought something like that:
Code:
DetachedCriteria criteria = DetachedCriteria.forClass(DBUser.class);
criteria.createAlias("myElements", "e")
criteria.add(Property.forName("e.<???>").eq(1L));
Is this possible?
What do I have to write for <???>. Or is there a different approach?
Thank you very much.
Stefan