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.
|