And even if you only use Hibernate, I would recommend referential integrity.
For example let's suppose you have an object having a collection of other objects (in a Map for example). If you load one of the object in the collection via session.load() and then delete it, I am not sure Hibernate will automatically delete it from the collections as well (it is your responsability to do so, I think) and then later you will have exceptions because one of the items in the collection is no longer in the DB. With referential integrity you are protected from that.
PS: can someone confirm that indeed Hibernate won't delete it from any collection where the object may be in?
|