java.lang.IllegalArgumentException: Property 'invoice.date' not found in busy$CustomerInvoiceSimpleLine
at com.haulmont.chile.core.model.impl.MetaClassImpl.getPropertyNN(MetaClassImpl.java:107)
at com.haulmont.charts.gui.pivottable.model.gson.PivotDataItemsSerializer.addProperty(PivotDataItemsSerializer.java:68)
Indeed PivotDataItemsSerializer uses getPropertyNN instead of getPropertyPath.
This is annoying because our Sales screen uses the same Datasource for a Table and a Pivot, and Table supports them. In fact they are supported quite everywhere in CUBA which is nice. But not in Pivot
Is there a way to override this class in some way ? Or another workaround ?
I thought defining a SaleEntry POJO and using jqpl NEW construct:
SELECT NEW SaleEntry(s.invoice.date, […]) FROM app$Sale s.
But it is not supported and if I understand correctly using JPA JPQL directly bypasses CUBA security.
I tried with 6.8.5 and 6.8.7 but I may have a lead : this is specific to dates.
Attached a project allowing to reproduce the issue, there are 2 pivot tables invoice-line-browse.xml and invoice-line-browse.xml.sav. The 2nd is the one with the issue.
Both pivot sum invoice lines and try to retrieve info from the invoice. Using property ‘invoice.customer’ works, but using property ‘invoice.date’ does not.
This is due to PivotDataItemsSerializer specific code when the property is a date (code below). This is a specific case that I think is not covered by https://youtrack.cuba-platform.com/issue/PL-8802.
EDIT : to be more precise, the issue is on a date property accessed through an association, a date property at 1st level works
Ok thanks Gleb. It seems small, do you think it can be patched on 6.8.9 for instance ?
I spend quite some time thinking of a workaround, but nothing simple has come to mind, and I don’t want to denormalize nearly each date in our analytics model just for that