[
https://issues.apache.org/jira/browse/OPENJPA-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17313448#comment-17313448
]
ASF subversion and git services commented on OPENJPA-2851:
----------------------------------------------------------
Commit 8f96a5bd798c8bbdbc03bf5a9551b1da6ef68370 in openjpa's branch
refs/heads/master from Mark Struberg
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=8f96a5b ]
OPENJPA-2851 fix CURRENT_DATE with LocalDate and LocalDateTime
bug in unit test
> argument CURRENT_DATE cannot handle java.time.LocalDateTime entity fields
> -------------------------------------------------------------------------
>
> Key: OPENJPA-2851
> URL: https://issues.apache.org/jira/browse/OPENJPA-2851
> Project: OpenJPA
> Issue Type: Bug
> Components: jpa
> Affects Versions: 3.1.2
> Environment: h2 database
> Reporter: Karl Grosse
> Assignee: Mark Struberg
> Priority: Major
> Fix For: 3.1.3
>
>
> Using CURRENT_DATE as argument in queries for LocalDateTimeFields yields a
> org.apache.openjpa.persistence.ArgumentException: Attempt to compare
> incompatible types "class java.time.LocalDateTime" and "class java.util.Date".
>
> Field in entity:
> @NotNull
> @Column(name = "USEDUNTIL", nullable = false)
> private LocalDateTime usedUntil;
> Example Query:
> @NamedQuery(name = QUERY_COUNT_BY_IDS,
> query = "SELECT COUNT(t) FROM Dokumente t WHERE t.dokumentId IN :dokumentId
> AND t.usedUntil >= CURRENT_DATE")
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)