cuba-platform / reports

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

Report run dialog works incorrectly with a very old date is a report parameter #290

Open gorbunkov opened 3 years ago

gorbunkov commented 3 years ago

Environment

Description of the bug or enhancement

  1. Create the entity with a Date field
  2. Create a report with "Table" output type based on JPQL query. The query must have a condition with Date parameter, e.g.:
select
e.stringField as "stringField",
e.dateField as "dateField"
from sample_MyEntity e where e.dateField >= ${dateField1}

Create a couple of entity instances. One of them should have a very old date in a date field, e.g. 01/01/0001

image

Run the report from the Report editor - type the 01/01/0001 value as a date parameter value

image

Expected behavior: the entity with the 01/01/0001 field will be in the results table Actual behavior: the entity with the 01/01/0001 field IS NOT in the results table

image

The problem is that DateField transforms the date and store the date modified by the com.haulmont.cuba.core.global.DateTimeTransformations. For very old dates these transformations are probably done incorrectly.

The sample project: report-date-error.zip

The forum topic: https://forum.cuba-platform.com/t/pivot-table-max-data-size/14866