Hi,
Following models a case I have...
The hierarchy (of unlimted levels) is of a top female horse and her female ancestors.
The "business" rule is that female horses can have daughter horses or daughter mules. Daughter mules can have daughter
horses, but daughter mules can have no children.
Example:
TopFemaleHorse
ChildFemaleMule(can have no children)
ChildFemaleHorse
GrandChildFemaleMule(can have no children)
GrandChildFemaleHorse
GreatGrandChildFemaleMule (can have no children)
GreatGrandChildFemaleHorse
GreatGreatGrandChildFemaleMule(can have no children)
GreatGreatGrandChildFemaleHorse
...
In the database, there are three tables for the TargetPerEntity hierarchy.
FemaleEquine
FemaleHorse
FemaleMule
In the FemaleEquine table, there is an ID column and a ParentID column.
Foreign keys:
FemaleEquine.ParentID referencing FemaleEquine.ID (for unlimited hierarchy)
FemaleHorse.ID referencing FemaleEquine.ID (for TargetPerEntity)
FemaleMule.ID referencing FemaleEquine.ID (for TargetPerEntity)
This works fine with llblgen (SqlServer database script and .NET project attached), except that FemaleMules are not constrained (in the database) to prevent them from being listed as parents.
Suggestion on the best way to reorganize to allow the FemaleHorses to be parents, but constrain the FemaleMules from being parents (in the database)?
Thanks!