Hi All,
Any one help me createCriteria using Joins ... Pls find the given below joins query :
public List getJobseekerWorkExperience(Integer id) {
StringBuffer selectClause = new StringBuffer( " select jswe.employerName, jswe.employerAddress, jswe.startFrom, jswe.endTo, jswe.visible, jswe.sortOrder, "); selectClause .append(" jswel.businessSector, jswel.occupationTitle, jswel.mainActivities, jswe.id "); StringBuffer fromClause = new StringBuffer( " from CvoJsWorkExperience as jswe, "); fromClause.append(" CvoJsWorkExperienceLingual as jswel "); StringBuffer whereClause = new StringBuffer( " where jswe.id=jswel.cvoJsWorkExperience and jswe.cvoJobseeker= "); whereClause.append(id); StringBuffer orderbyClause = new StringBuffer( " order by jswe.sortOrder ");
Query q = session.createQuery(selectClause.toString() + fromClause.toString() + whereClause.toString() + orderbyClause.toString()); List results = q.list(); return results;
}
|