Hi,
I am trying to create Criteria query for a multiCriteria search functionality.
Code:
Criteria criteria = session.createCriteria(CCase.class);
.setFetchMode("caseGroupOwners", FetchMode.JOIN) .setFetchMode("caseGroupOwners.cGroup",FetchMode.JOIN);
Where CCase has a <set> caseGroupOwners (1-M relationship)
and caseGroupOwners has M-1 relationship with cGroup
CCase - caseGroupOwners - cGroup
However, when I use caseGroupOwners.cGroup in the setFetchMode clause, it does not resolve the property. It gives an exception that
cGroup is not a property of
CCase.
If we need to do outerjoins and if we have a M-M relationship as above what do we need to use? or how do we specify the above relationship in the setFetchMode?
Appreciate your feedback,
Thanks.