jeudi 5 novembre 2020

Multilevel data - check hierarchy

I have a hierarchical dataset that has an arbitrary number of levels. To simplify this, let's assume there are only five levels that are:

1 grandfather 2 father 3 son 4 granddaughter 5 great grandson

the problem is to check that when I insert a child element the association with the parent is legitimate.

it is possible to insert a son and a granddaughter under the grandfather but not a great grandson who must necessarily be associated with a granddaughter.

Is there a pattern for such a problem?

Aucun commentaire:

Enregistrer un commentaire