Hello,
I have a chain of compositions:
Branch.workers (set) ---> Worker.contracts(list) ---> Contract.paylsips (list) ...
Each item of a composition knows its parent: worker.branch, contract.worker, payslip.contract. All of these attributes are specified as mandatory.
Everything runs fine when I try to remove:
- a worker from a branch;
- a contract from a worker.
But I get an integrity.property.mandatory message when I try to remove a payslip from a contract.
The issue is created by AbstractComponentInvocationHandler.invoke(proxy, method, args).
When accessorInfo.isModifier() is true, jspresso checks if modifierMonitors contains already method.getName():
- if it's the case, then it quits immediatly the method and everything is fine;
- otherwise, it adds the method name to modifierMonitors and ... continues. Then when propertyDescriptor.preprocessSetter(proxy, actualNewProperty) is called, as payslip.contract is mandatory, the message aboves is thrown.
IMO, with a composition, there is no reason to reset the value of the reverse property.
I fear I miss something obvious, but ATM in AbstractComponentInvocationHandler.removeFromProperty.removeFromProperty, I use this patch:
if (collectionProperty.contains(value)) {
IRelationshipEndPropertyDescriptor reversePropertyDescriptor = propertyDescriptor
.getReverseRelationEnd();
if (reversePropertyDescriptor != null) {
if (!propertyDescriptor.isComposition() &&
(reversePropertyDescriptor instanceof IReferencePropertyDescriptor<?>)) {
[...]
Pierre

