Hi all
How can I prevent NHibernate from deleting a single entity of a specific class? A programmatic way I am using at the moment entails checking for the entity's unique field "Name".
Here's the scenario: I have a person and a group. The group can have persons and other groups. If the group named "Admins" is attempted to be deleted, it will not, due to transaction-level constraints that I enforce (specifically checking for the group's 'Name' column/field, as this is unique). So that's fine.
But now I'm thinking that if another group is created and the "Admins" becomes a sub-group of that, the check will fail. This will mean the deletion of "Admins". So I'm looking for a better way, other than traversing the parent/child containment tree, e.g. using NHibernate
I can't use a class-wide restriction such as 'class Mutable=false', I mean having a read-only restriction on one or two individual entities of a certain class.
Regards,
_NT