1 Reply Latest reply on Jan 12, 2009 5:52 AM by Sachin Jain

    org.jboss.ejb.plugins.cmp.ejbql.ParseException

    catherine lo Newbie

      I created a finder method trying to get the latest sessionId from mySQL.
      SELECT DISTINCT object(u) FROM UsageSession u WHERE u.station = ?1 AND u.card = ?2 AND u.sessionId=(SELECT MAX(u2.sessionId) FROM UsageSession u2 WHERE u2.station = ?1 AND u2.card = ?2)

      When I deploy it, I get the following Exception:
      Caused by: org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "SELECT"
      at line 1, column 101.
      Was expecting one of:
      "ABS" ...
      "LENGTH" ...
      "LOCATE" ...
      "SQRT" ...
      "MOD" ...
      "(" ...
      "+" ...
      "-" ...
      <INTEGER_LITERAL> ...
      <FLOATING_POINT_LITERAL> ...
      <NUMERIC_VALUED_PARAMETER> ...
      <NUMERIC_VALUED_PATH> ...


      How can I resolve this problem? Please help me.

      Thanks in advance