[ 
https://issues.apache.org/jira/browse/OPENJPA-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134622#comment-18134622
 ] 

ASF subversion and git services commented on OPENJPA-3042:
----------------------------------------------------------

Commit 4cb46d12e1647ca0c040e6a50deeff0225159f7f in openjpa's branch 
refs/heads/OPENJPA-3044 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=4cb46d12e ]

[OPENJPA-3042] Evaluate EXTRACT in memory with the ISO week and every temporal 
type (#239)

* [OPENJPA-3042] Evaluate EXTRACT in memory with the ISO week and the local 
date and time of each temporal type

WEEK was mapped to ALIGNED_DAY_OF_WEEK_IN_YEAR, a day of the week, and is now
the ISO-8601 week of the week based year. A java.sql.Timestamp was read as an
Instant, which has no calendar fields, and java.util.Date, Calendar and
Instant were rejected; they are now read as a local date and time. SECOND
keeps the nanoseconds and EXTRACT of null is null.

* [OPENJPA-3042] Evaluate EXTRACT(DATE/TIME) in memory for every temporal type 
and render WEEK as ISO_WEEK on H2

* [OPENJPA-3042] Use pattern matching in toTemporal

> In-memory EXTRACT(WEEK) returns the day of the week
> ---------------------------------------------------
>
>                 Key: OPENJPA-3042
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3042
>             Project: OpenJPA
>          Issue Type: Sub-task
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> When EXTRACT(WEEK) is evaluated in memory, {{DateTimeExtractField.WEEK}} is 
> mapped to {{ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR}}, which is a day-of-week 
> value (1 to 7), not the ISO week of the year. It should use 
> {{IsoFields.WEEK_OF_WEEK_BASED_YEAR}}, matching the SQL side (OPENJPA-3037). 
> Found while testing OPENJPA-3029.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to