Topics

JPQL date literrals: documentation error


passignat@...
 

Regarding date format, there is a error in the documentation. Month are specified as 'mm' like minutes. It would be better to mention MM (looks like SimpledateFormat)

JPQL supports literals of the following types : Number, boolean, character, String, NULL and temporal. When String literals are specified using single-string format they should be surrounded by single-quotes '. Please note that temporal literals are specified using JDBC escape syntax in String form, namely

{d 'yyyy-mm-dd'}                 - a Date
{t 'hh:mm:ss'}                   - a Time
{ts 'yyyy-mm-dd hh:mm:ss.f...'}  - a Timestamp
--
Stephane


Andy
 
Edited

Well it maybe would, BUT references in the JDBC spec don't do that. See https://download.oracle.com/otn-pub/jcp/jdbc-4_1-mrel-spec/jdbc4.1-fr-spec.pdf
and in particular section 13.4.2. Clearly this is in SQL space not Java space hence there is no direct parallel with SimpleDateFormat

If you feel strongly about it, why not provide a pull request for the docs https://github.com/datanucleus/docs-accessplatform