-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to createCriteria using this query joins?
PostPosted: Mon Jun 08, 2009 7:04 am 
Newbie

Joined: Fri Jan 02, 2009 2:14 am
Posts: 15
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;

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.