rzo1 opened a new pull request, #255:
URL: https://github.com/apache/openjpa/pull/255

   https://issues.apache.org/jira/browse/OPENJPA-3048
   
   When a query is evaluated in memory (e.g. `setCandidateCollection`), a JDBC 
escape literal like `{d '2021-01-03'}` stayed a string, so `EXTRACT` failed and 
comparisons with date/time fields differed from the database.
   
   - `Lit` parses `{d}`, `{t}` and `{ts}` literals into `java.sql.Date`, `Time` 
and `Timestamp`.
   - New `Filters.promoteForComparison` picks the common type when comparing 
java.time, `java.sql` and `java.util.Date` values; used by `CompareExpression`, 
`SimpleCase` and `NullIf`. `Filters.promote` is unchanged since the SQL side 
uses it for casts.
   - `Filters.convert` handles `java.sql.Date`/`Time` without calling 
`toInstant()` (which throws) and converts a `Date` to `Timestamp`.
   
   New `TestInMemoryJDBCEscapeLiterals` runs the same queries on the database 
and in memory (managed and new entities, literal on either side, CASE and 
NULLIF). Full suites pass on Derby and H2.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to