I want to implement a multi-way tree using core data. There's a "Plan" entity in my core data model.
Plan
/ | \
Plan Plan Plan
/ | \ | | \
Plan Plan ...
The plan of the higher level will have to-many relationship with the sub-plans.
So how should I set the relationship?
I would define
subplans
(or children
) from the Plan entity to itself, with the "Delete Rule" set to "Cascade",superplan
(or parent
) from the Plan entity to itself, with the "Delete Rule" set to "Nullify",If you delete one Plan object, then automatically
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With