0 Replies Latest reply on Oct 8, 2004 7:05 AM by papps

    Date comparison in EJB ql or JBoss ql

    papps

      Hi,

      I am trying to make a simple date comparison in JBoss 3.2.5 but I always have parsing errors.
      I am using a mySQL database and java.util.Date java type with the default jboss data mapping.

      Here is my query :
      SELECT OBJECT(dt) FROM DT_REGISTRY as dt WHERE dt.creationTime + dt.timeoutDelay > ?1

      (the parameter ?1 is initialized to the current date)

      and the error message :

      11:59:56,251 INFO [STDOUT] org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "+" at line 1, column 64.
      Was expecting one of:
      "BETWEEN" ...
      "NOT" ...
      "IN" ...
      "=" ...
      ">" ...
      ">=" ...
      "<" ...
      "<=" ...
      "<>" ...


      If i don't use arithmetic, it works but this is not what I want ...

      SELECT OBJECT(dt) FROM DT_REGISTRY as dt WHERE dt.creationTime > ?1 works fine.

      I tried it in ejb ql or in jboss ql: same error.

      Any ideas ?
      Thanks,
      - Papps