cuba-platform / reports

CUBA Reports Addon
https://www.cuba-platform.com/
Apache License 2.0
9 stars 4 forks source link

Incorrect handling of LocalTimeDate parameter #240

Closed NikitaShchienko closed 4 years ago

NikitaShchienko commented 4 years ago

Environment

Description of the bug or enhancement

  1. Create an entity with LocalDateTime field Example:

    @Table(name = "REPORTTEST_TEST_ENTITY")
    @Entity(name = "reporttest_TestEntity")
    public class TestEntity extends StandardEntity {
    private static final long serialVersionUID = 2502441991887112085L;
    
    @Column(name = "LOCALDATETIME")
    protected LocalDateTime localDateTime;
    
    public LocalDateTime getLocalDateTime() {
        return localDateTime;
    }
    
    public void setLocalDateTime(LocalDateTime localDateTime) {
        this.localDateTime = localDateTime;
    }
    }
  2. Create a new report with parameter for this entity.

image

  1. Run this report

Expected behavior:

A new report should be created.

Actual behavior:

Error:

An error occurred while loading data for band [TestEntitys] and query [Dataset]. Report name [Report for entity "Test entity"]
An error occurred while loading data for data set [Dataset]
Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.7.3.6-cuba): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [16.01.20 15:15], of class [class java.util.Date], could not be converted to [class java.time.LocalDateTime].
Internal Exception: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0

Exception Description: The object [16.01.20 15:15], of class [class java.util.Date], could not be converted to [class java.time.LocalDateTime].
Internal Exception: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
Invalid value for MonthOfYear (valid values 1 - 12): 0