I have the below code
ArrayList<String> city = 'Anniston';
Criteria crit = session.createCriteria(CandidateResumeInfo.class);
crit.add(Restrictions.eq("resumeSearchable", 1));
Now i want to add below criteria
crit.add(Restrictions.in("cities", city));
but the problem is that cities column is not in CandidateResumeInfo.class its in CandidateInfo Class.
Any idea how to add this criteria as well in the above one,how to add CandidateInfo class as well in the above criteria.
guess i need to do join or link these two tables but how ,and will there be any changes in the entity classes ?
thanks
You didn’t describe your associations but I assume it would be something like
In this case you would need something like
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querycriteria.html
check section about associations.