[
https://issues.apache.org/jira/browse/OPENJPA-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314209#comment-17314209
]
ASF subversion and git services commented on OPENJPA-2851:
----------------------------------------------------------
Commit 76225267d90f9abe559dc63a7f5f74a1aa5bcd93 in openjpa's branch
refs/heads/master from Mark Struberg
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=7622526 ]
OPENJPA-2851 simplify comparison
since java.time classes are final we can also use == instead of isAssignableFrom
> 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)