-->
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: hql query problem
PostPosted: Tue Nov 21, 2006 7:13 am 
Newbie

Joined: Tue Nov 21, 2006 6:53 am
Posts: 1
hi ,
I am developing a application for conducting survey.
I am working on diffrent tables given below.

Survey,
Survey sections,
Survey Questions
Survey Answers


I wrote a query to get Overall survey object which contains information
about all the tables.Hql query for this is

select s from Survey as s where s.codeValue= :codevalueid and s.displayname= :name and s.versionnumber= :versionno

but I need a query in a situation where I will pass only answer choices
and I have to get all the survey information which contains the information about survey,survey sections,survey questions and answers excluding questions which contains the answer choicesids I passed.

I have tried using below query for this ....

select distinct s from Survey as s,SurveySection ss,SurveyQuestion sq where s.codeValue= :codevalueid and s.displayname= :name and s.versionnumber= :versionno and sq.surveyquestionid not in(select distinct sac.surveyQuestion from SurveyAnswerChoice sac where sac.surveyanswerchoiceid in (1,2,3,4))

but i got the questions for which i have passed the answer choices as well.


Thanks,
Suresh.


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.