Hibernate cascade delete on a bag
Posted
by littlecharva
on Stack Overflow
See other posts from Stack Overflow
or by littlecharva
Published on 2010-04-28T09:22:56Z
Indexed on
2010/04/28
9:33 UTC
Read the original article
Hit count: 318
nhibernate
|hibernate
Howdy,
Having built most of my DAL using NHibernate, I've now discovered that the SQL Server's Cascade On Delete rules also need to be taken into account in my HBM files too. I've been using bags for all my collections, but there doesn't seem to be a way to add a cascade="delete" attribute to a bag. I can change all my bags to sets, but that appears to mean I have changing all my IList<>s on my models to PersistentGenericSet<>s, which I don't really fancy doing.
Any advice?
Anthony
© Stack Overflow or respective owner