Please take a closer look at the EJB-QL grammar. The specification does not allow the use of a datetime in a between clause. You will need to either use JBossQL or you will need to use the > and < operators.
If you use the symbols < and > in a XML-file, you have to put the SELECT-command in
SELECT Object(p) FROM table AS p WHERE (p.date <= ?1) AND (p.date >= ?2)
But if I do so, the JBuilder 6.0 turns my SELECT-command into:
SELECT Object(p) FROM table AS p WHERE (p.date >= ?1) AND (p.date <= ?2)
First question: Is this correct?
Second question: If not, what could I do (except changing my IDE of course ;-) )?
The error message doesn`t change, although I`m not using BETWEEN clausule anymore...
If you read the EJB-QL grammar closely, you will notice that the >= and <= operators are not allowed for datetime types. You are only allowed to use the < and > operators. Borlan allows you to use the other operators in an attempt to make your application less portable.