1 Reply Latest reply on Nov 15, 2006 12:09 PM by Leo Martin

    EJB_QL comparing a constant to an input parameter

    Leo Martin Newbie

      When I try to deploy to JBoss I am getting the error:

      - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "= sx.routeId ) AND ( sx.ftsegId =
      x.ftsegId ) AND ( s.routeId = 1 ) AND ( ( ( 0 =" at line 1, column 89.
      vm 1 | Was expecting one of:
      vm 1 | ")" ...
      vm 1 | "+" ...
      vm 1 | "-" ...
      vm 1 | "*" ...
      vm 1 | "/" ...
      vm 1 | "=" "+" ...
      vm 1 | "=" "-" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "*" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "/" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "+" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "-" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "AND" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> "OR" ...
      vm 1 | "=" <NUMERIC_VALUED_PATH> ")" "AND" "NOT" ...

      It seems to deploy and run fine on Weblogic.

      The error seems to be with (0 = ?2) where I am comparing a constant (int) to an input parameter(int). How do I accomplish this with JBoss?

      SELECT Object(s) FROM Subroute s, SubrouteXref sx, FtsegCountyXref cx WHERE ((s.routeId = sx.routeId) AND (sx.ftsegId = cx.ftsegId) AND (s.routeId = ?1) AND (((0 = ?2) AND((s.direction = 'EASTBOUND') or (s.direction = 'NORTHBOUND') or (s.direction = 'BIDIRECTIONAL') or (s.direction = 'ONEWAY'))) OR ((1 = ?2) AND ((s.direction = 'WESTBOUND') or (s.direction = 'SOUTHBOUND') or (s.direction = 'ONEWAY'))))AND (cx.containingCountyNumber = ?3) AND (sx.status = 'ACTIVE'))