Hello together,
lower you will find a small Demo Project regarding this issue. Following scenario:
Datascource of the Root “Order” Entity Editor is setup correctly:
,as described here
But there is one special case, i still get an Error:
I CREATE an new Order
I CREATE an Order-Line inside the Order
I CREATE an Order-Line-Position inside the Order-Line
Before Saving the Order, I delete the Order-Line, i have just created:
I try to save the Order and get the following Error:
Here is the Demo Project so you can reproduce the issue:
Test-Project_PERSIST_BUG.zip (100.3 KB)
Thanks for the Help in advance
Daniel
shiryaeva
(Olga Shiryaeva)
October 25, 2018, 11:18am
#4
Hi Daniel,
This issue can be solved by setting the allowCommit attribute to false in the 2nd nested datasource:
<datasource id="orderDs"
class="com.company.testprojectpersistbug.entity.Order"
view="order-line-posititon">
<collectionDatasource id="lineDs"
property="line">
<collectionDatasource id="posititonDs"
property="posititon"
allowCommit="false"/>
</collectionDatasource>
</datasource>
Thus, the isModified() method of this datasource will always return false, the commit() method of OrderLinePositionEdit screen will do nothing, and all changes will be saved only together with the master entity.
1 Like