Delete Cascade is not working with NHibernate
问题 I have a table Communication which has a reference to PersonCompany. In the mapping for PersonCompany i have defined a Cascade-Delete for this reference: this.HasMany(x => x.Communications) .AsSet() .KeyColumn("PersonCompanyId") .Fetch.Select() .Inverse() .Cascade.Delete(); But when I now execute the fallowing HQL-Query: var sql = "delete from PersonCompany where Person.Id in (:idList) or Company.Id in (:idList)"; with var query = NHibernateHelper.CurrentSession.CreateQuery(sql); query