我对软删除类的nhibernate有一些疑问 我使用示例中使用的一个覆盖DefaultDeleteEventListener类 (http://nhibernate.info/blog/2008/09/06/soft-deletes.html)
class MMPDeleteEventListener : DefaultDeleteEventListener
{
protected override void DeleteEntity(IEventSource session, object entity,
EntityEntry entityEntry, bool isCascadeDeleteEnabled,
IEntityPersister persister, ISet transientEntities)
{
if (entity is ISoftDeletable)
{
var e = (ISoftDeletable)entity;
e.IsDeleted = true;
CascadeBeforeDelete(session, persister, entity, entityEntry, transientEntities);
CascadeAfterDelete(session, persister, entity, transientEntities);
}
else
{
base.DeleteEntity(session, entity, entityEntry, isCascadeDeleteEnabled,
persister, transientEntities);
}
}
}
问题是如何说nhibernate软关系所有多对多和多对一的关系? 我不想丢失数据库中的数据。 我的问题并没有明确告诉我,我试图解释它更多因为我是