How to solve it:
Code:
List<Contact> contact = session.createCriteria(T1.class)
.createCriteria("T2").add(Restrictions.eq("property", "value")).list()
My next problem: I cant search through 2 different many-to-many Relations:
Code:
List<Contact> contact = session.createCriteria(T1.class)
.createCriteria("T2").add(Restrictions.eq("property", "value"))
.createCriteria("T3").add(Restrictions.eq("property3", "value"))
.list()
The Criteria class tries to get the property3 Attribute from the T2 Entity. This attribute is in the T1 Entity... anybody got an idea?