I am having difficulty getting off the ground with Criteria. I have the following HQL statement which works fine, and I am trying to build tyhe corresponding Criteria version.
Code:
from Order ord left join fetch ord.Rep where ord.Rep.RepGroup.Code > :code.
1st try:Code:
Criteria criteria = session.createCriteria(Order.class);
criteria = criteria.setFetchMode("Rep", FetchMode.JOIN);
criteria = criteria.add(Expression.ge("Order.Rep.RepGroup.Code", repCode));
I get the error
Code:
org.hibernate.QueryException: could not resolve property: Order of: com.myapp.Order
2nd tryCode:
Criteria criteria = session.createCriteria(Order.class);
criteria = criteria.setFetchMode("Rep", FetchMode.JOIN);
criteria = criteria.add(Expression.ge("Rep.RepGroup.Code", repCode));
I got the error:
Code:
org.hibernate.QueryException: could not resolve property: Rep.RepGroup.Code of: com.myapp.Order
3rd tryCode:
Criteria criteria = session.createCriteria(Order.class);
criteria = criteria.setFetchMode("Rep", FetchMode.JOIN);
criteria = criteria.add(Expression.ge("RepGroup.Code", repCode));
I got the error:
Code:
org.hibernate.QueryException: could not resolve property: RepGroup of: com.mypp.Order
Any assistance much apprectaied.