5 Replies Latest reply on Dec 28, 2011 11:34 AM by Wolf-Dieter Fink

    EJB 2.1 Query language issue

    Dharmendra Sankhla Newbie

      Hi,

       

      I am currently using Jboss 5.1 GA version and trying to migrate Entity beans

       

      from Weblogic 8.1 to Jboss.

       

      As i under stand EJB QL which is part of ejb-jar.xml

       

      is a standard and should work across the application servers, however when i try to use same EJb QL in Jboss 5.1 it throws exception

       

      I noticed that it throws exception only when i try to add day in a date. Please ses the highlighted underlined part in EJB QL

      Following i the EJB QL which i am using

       

       

      SELECT OBJECT(o) FROM CampEJB as o WHERE o.clientID= ?1 AND o.locationID = ?2 AND (o.brand = ?3 OR o.brand = 'All') and o.active = ?4 and o.startDate <= ?5 and ((o.endDate is not null and o.endDate + 1 >= ?5) OR (o.endDate is null)) ORDERBY o.priority

       

       

      When i use above EJB QL it throws following exception, Any help would be greatly appreciated.

       

      06:57:06,206 ERROR [CampEJB#findByBrandLocationDate] Encountered "o.endDate is not null and ( o.endDate +" at line 1, column 168.

      Was expecting one of:

          "ABS" ...

          "LENGTH" ...

          "LOCATE" ...

          "SQRT" ...

          "MOD" ...

          "(" ...

          "+" ...

          "-" ...

          <INTEGER_LITERAL> ...

          <FLOATING_POINT_LITERAL> ...

          <NUMERIC_VALUED_PARAMETER> ...

          <NUMERIC_VALUED_PATH> ...

          "NOT" ...

          <COLLECTION_VALUED_PATH> ...

          <STRING_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "NOT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "NOT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "(" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <COLLECTION_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <STRING_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "CONCAT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "SUBSTRING" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <BOOLEAN_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> "=" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> ">" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> "<" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> "<>" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> ">=" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <DATETIME_VALUED_PATH> "<=" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <ENTITY_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <IDENTIFICATION_VARIABLE> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <NUMERIC_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "LENGTH" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "LOCATE" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "ABS" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "SQRT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "MOD" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "+" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" "-" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <INTEGER_LITERAL> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <FLOATING_POINT_LITERAL> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "(" <NUMERIC_VALUED_PARAMETER> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <COLLECTION_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <STRING_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "CONCAT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "SUBSTRING" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <BOOLEAN_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <DATETIME_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <ENTITY_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <IDENTIFICATION_VARIABLE> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <NUMERIC_VALUED_PATH> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "LENGTH" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "LOCATE" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "ABS" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "SQRT" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "MOD" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "+" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" "-" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <INTEGER_LITERAL> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <FLOATING_POINT_LITERAL> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "AND" <NUMERIC_VALUED_PARAMETER> ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" "OR" ...

          <DATETIME_VALUED_PATH> "IS" "NOT" "NULL" ")" ...