Reputation: 12925
I have a entity called "Category" and a entity called "item". Category may have one or more sub categories or have one or more items.
Here is what I designed.
But I have a special requirement. If the category has items, it won't have sub-categories. I don't know how to do this in my model design.
Any suggestions, thanks
Upvotes: 0
Views: 673
Reputation: 80273
To my knowledge, there is no way to model this in the data model. You have to simply check for items before you create the subcategory.
Also, when deleting items, check if they leave any empty categories with (also empty) subcategories.
Upvotes: 1