Menu

#52 Hibernate deleting lines, not update @Sum value in other parent

Needs More Info
open
nobody
None
2.2.0
Max
engine
critical
2013-07-31
2013-07-31
No

If the application user deletes a child, the corresponding @Sum value is correctly updated in secondary parent, but if the user deletes a primary parent, delegating hibernate deleting lines, the lines and primary parent are erased but the @Sum value is not updated in secondary parent.

I have PurchaseOrder with:
@OneToMany(cascade=CascadeType.REMOVE)
private <List>PurchaseOrderLine lines;

and YearMonth with:
@OneToMany
private <List>PurchaseOrderLine lines;

and in YearMonthLogic:
@Sum("lines.qty") deriveQtyMonthly();

If the application user deletes a PurchaseOrderLine the corresponding @Sum value is correctly updated in YearMonth, but if the user deletes a purchase order, delegating hibernate deleting lines, the lines and purchase order are erased but the @Sum value is not updated.
(In other cases, when the relationship is @OneToOne(cascade=CascadeType.REMOVE), this bug does not happen)

Discussion

Anonymous
Anonymous

Add attachments
Cancel