Hi all,
I have a lot of troubles with this and I decided to ask here.
Right now, I want to simultate the tipical trigger on database. I have an Entity A, and it has a collection of Entity B.
From another entity, I create a new Entity A, and several Entity B attached to entity A. After some troubles I finally got it working as expected commiting in the middle of the process (I would really like to know how in screen works without commiting, but this is another question.
Again, Now, I have an Entity A with a collection of Entity B, and Entity B has a EntityListener afterInsert to call a parent function to recalc:
entity.getEntityA().calcTotals();
Under Entity A calcTotals() I have:
for (Iterator iterator = this.getEntityBCollection().iterator(); iterator.hasNext();){
but getEntityBCollection always return null in this point.
Same code works as expected If I go to the screen, create a new Entity A, and create an EntityB for it.
Whats happening and wich is the correct way to work around that?