You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Mark Struberg (Jira)" <ji...@apache.org> on 2021/04/01 19:22:00 UTC

[jira] [Assigned] (OPENJPA-2851) argument CURRENT_DATE cannot handle java.time.LocalDateTime entity fields

     [ https://issues.apache.org/jira/browse/OPENJPA-2851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg reassigned OPENJPA-2851:
--------------------------------------

    Assignee: Mark Struberg

> 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
>
> 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)