You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's assume that two entities are defined: Order and OrderLineItem with a one-to-many @composition.
The OrderDetailView contains a DataGrid of OrderLineItem.
If you enable aggregation for this DatGrid and add multiple items, an error will occur.
Current Behavior
An error:
java.lang.IllegalArgumentException: entity or id is null
at io.jmix.core.common.util.Preconditions.checkNotNullArgument(Preconditions.java:101)
at io.jmix.flowui.model.impl.CollectionContainerImpl.getItemIndex(CollectionContainerImpl.java:123)
at io.jmix.flowui.model.impl.CollectionContainerImpl.getItemOrNull(CollectionContainerImpl.java:117)
at io.jmix.flowui.model.impl.CollectionContainerImpl.getItem(CollectionContainerImpl.java:108)
at io.jmix.flowui.data.grid.ContainerDataGridItems.getItemValue(ContainerDataGridItems.java:208)
at io.jmix.flowui.data.aggregation.impl.AggregatableDelegate.lambda$valuesByProperty$0(AggregatableDelegate.java:197)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
The error occurred because the io.jmix.core.entity.EntityValues#getId method was used as aggregation items ID provider.
Since composite entities receive their ID only after the parent entity is saved, this method of getting the ID would throw an error. Now io.jmix.core.entity.EntityValues#getIdOrEntity will be used.
Environment
Jmix version: 2.2.999-SNAPSHOT
Bug Description
Let's assume that two entities are defined:
Order
andOrderLineItem
with a one-to-many@composition
.The
OrderDetailView
contains aDataGrid
ofOrderLineItem
.If you enable aggregation for this
DatGrid
and add multiple items, an error will occur.Current Behavior
An error:
Expected Behavior
Aggregation will be updated without any errors.
Sample Project
aggregationBug.zip
The text was updated successfully, but these errors were encountered: