Just
a sily note, but will be useful if you correct the documentation
CascadeTypeRemoveOrphan must be [TCascadeType.RemoveOrphan]
example:
procedure OnManyValuedAssociationGenerated(Args: TManyValuedAssociationGeneratedArgs); begin case Args.CodeType.Name of 'TEmployees': case Args.Field.Name of 'FEmployeesList':
TCodeSnippetExpression(Args.AssociationAttr.Arguments[1].Value).Value
:= '[TCascadeType.SaveUpdate, TCascadeType.Merge,
TCascadeType.RemoveOrphan]'; end; end; end;
Thanks for the feedback, we will fix it. But it should be "CascadeTypeAllRemoveOrphan", not "[TCascadeType.RemoveOrphan]".
Example:
procedure OnManyValuedAssociationGenerated(Args: TManyValuedAssociationGeneratedArgs);
begin
case Args.CodeType.Name of
'TEmployees':
case Args.Field.Name of
'FEmployeesList':
TCodeSnippetExpression(Args.AssociationAttr.Arguments[1].Value).Value := 'CascadeTypeAllRemoveOrphan';
end;
end;
end;