I am looking for criteria for sleep mode:
Dokument.class maps to role Role identifier
Role.class has a ContactID contact person
Contact.class Name LastName
I want to find First or LastName in the Contact class and get a list of connected Dokuments.
I tried something like this:
session.createCriteria(Dokument.class) .setFetchMode("role",FetchMode.JOIN) .setFetchMode("contact",FetchMode.JOIN) .add(Restrictions.eq("LastName","Test")).list();
I get an error, I can not resolve the property "LastName" for the class "Document"
Can someone explain why search by query in Document and not on all joined tables? Thank you in advance for your help!
join hibernate criteria
mahatmanich Jan 04 '12 at 11:50 2012-01-04 11:50
source share