Discussions

EJB programming & troubleshooting: IN Operator in ejb ql

  1. IN Operator in ejb ql (1 messages)

    I'm trying to write a query that use the in operator: @NamedQuery(name="findAnswersByLoginIdAndQuestionList", query="select object(o) from Answers o Where o.loginId = :loginId AND o.questionId IN :questionId") but I'm getting an error: Exception Description: Syntax Recognition Problem parsing the EJBQL [select object(o) from Answers o Where o.loginId = :loginId AND o.questionId IN :questionId]. The parser returned the following [unexpected token: IN]. What am I doing wrong here?
  2. Re: IN Operator in ejb ql[ Go to top ]

    I'm trying to write a query that use the in operator:

    @NamedQuery(name="findAnswersByLoginIdAndQuestionList", query="select object(o) from Answers o Where o.loginId = :loginId AND o.questionId IN :questionId")

    but I'm getting an error:

    Exception Description: Syntax Recognition Problem parsing the EJBQL [select object(o) from Answers o Where o.loginId = :loginId AND o.questionId IN :questionId]. The parser returned the following [unexpected token: IN].

    What am I doing wrong here?
    try o.questionId IN (:questionId)