EJB-QL does not allow dates for the between function. Use the > and < operators instead.
Doesn't the EJB-QL specification state that you should not use Date at all? From section 11.2.11 of the specification:
"Date and time values should use the standard Java long millisecond value. The standard way to produce
millisecond values is to use java.util.Calendar."
That section is just saying that dates should have the resolution of milliseconds, but does not say you shouldn't use dates. The date stuff in the CMP specification is very poorly written. I think this is on purpose as temporal data is a very difficult issue, and there are really not right aswers.