I remember that this idea was once posted on this forum, unfortunately I cannot dig it now. At that time, Qiang replied this is so application specific that the framework does not take care of it.
Since this is the second time for me to come across this situation, I would like to post this again.
A User has MailingLists (A MailingList belongs to a User)
A MailingList has Subscribers (A Subscriber belongs to a MailingList)
In this case, we can apply the ‘unique’ rule to the mailinglist->name since this should be unique in the system wide. On the other hand, the subscriber->name is not necessary be unique in the system wide, but should be unique in a mailinglist.
More detailed situation, on the ‘insert’ scenario, subscriber’s name must be unique in a mailinglist, i.e. no other same name should exists in a mailinglist. On the other hand, on the ‘update’ scenario, the name should be unique except itself, i.e. the record having same name and same id should exists but no other record having same name and different id should exists.
I would like to have this rule as this is not so application specific. If there is a relation, it almost always have this kind of limited uniqueness.