How to find if a referenced object can be deleted?
I have an object called "Customer" which will be used in the other tables as foreign keys. The problem is that I want to know if a "Customer" can be deleted (ie, it is not being referenced in any other tables). Is this possible with Nhibernate? Jaguar What you are asking is to find the existence of the Customer PK value in the referenced tables FK column. There are many ways you can go about this: as kgiannakakis noted, try to do the delete and if an exception is thrown rollback. Effective but ugly and not useful. This also requires that you have set a CASCADE="RESTRICT" in your database. This