I am using hibernate-2.1 with Oracle 9i database. I'm trying to run the following query:
"select quest, count(answerResp) " +
"from Survey survey, " +
"User user, " +
"SurveyParticipant participant, " +
"SurveyResponse surveyResp, " +
"Question quest, " +
"QuestionResponse questResp " +
"AnswerResponse answerResp " +
"where survey.primaryKey = ? " +
"and user.primaryKey = ? " +
"and participant.user = user " +
"and participant.survey = survey " +
"and surveyResp.survey = survey " +
"and surveyResp.respondent = participant " +
"and quest.survey = survey " +
"and quest.required = 'T' " +
"and quest.questionType != " + QuestionType.DATA_TABLE.toInt() + " " +
"and questResp.question = quest " +
"and questResp.response = surveyResp " +
"left outer join answerResp.questionResponse as questResp " +
"group by quest " +
"having count(answerResp) = 0 " ;
i think the left outer join it causing the problem but i don't know how to reslove it, or what the problem is exactly.
I'm getting this error when parsing the query:
DEBUG QueryTranslator:147 - compiling query
DEBUG QueryTranslator:165 - unexpected query compilation problem
java.util.NoSuchElementException
at java.util.LinkedList.getLast(LinkedList.java:114)
at net.sf.hibernate.hql.WhereParser.closeExpression(WhereParser.java:293)
at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:233)
at net.sf.hibernate.hql.WhereParser.end(WhereParser.java:275)
at net.sf.hibernate.hql.ClauseParser.endChild(ClauseParser.java:100)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:64)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
please help...
|