I need to express the following HQL using Criteria:
from filter4 where filter1.filter2.inttest=10
I have tried these alternatives with no success:
Criteria criteria = session.createCriteria("filter4"); criteria.createAlias("filter1", "filter1"); criteria.createAlias("filter1.filter2", "filter2");
criteria.add(Restrictions.conjunction() .add(Restrictions.eq("filter2.inttest","10")) ); criteria.list();
And:
Criteria criteria = session.createCriteria("filter4"); criteria.createAlias("filter1.filter2", "a");
criteria.add(Restrictions.conjunction() .add(Restrictions.eq("a.inttest","10")) );
criteria.list();
Your help would be greatly appreciated.
Last edited by jmpeace on Thu Mar 05, 2009 5:32 pm, edited 1 time in total.
|