1 Reply Latest reply on Sep 9, 2002 5:19 PM by Dain Sundstrom

    ejbql/jbossql compile exception

    Bernd Bauer Newbie

      Hi!
      Is it true, that ejb-ql nor jboss-ql (JBOSS 3.0.0) allow the comparison of input parameters against constants? I always get an exception (ejb-ql and jboss-ql) at deployment from this expression: (?2 = 100)
      It is the same for (100 = ?2).

      org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "=" at line 1, column 88.
      Was expecting one of:
      ")" ...
      "+" ...
      "-" ...
      "*" ...
      "/" ...
      "NOT" ...
      "BETWEEN" ...
      )


      <query-method>
      <method-name>findByContractType</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>int</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[
      SELECT DISTINCT OBJECT(p) FROM ProductTypeBean p
      WHERE
      p.contractType.id = ?1
      AND ( (?2 = 100)
      OR ((?2 = 101) AND ((p.state = 1) OR (p.state= 2)))
      OR (p.state = ?2)
      )]]>
      </ejb-ql>