У меня есть три отображения следующим образом:NHibernate каскад и обратный
public MainChapterMap()
{
// other properties
HasMany(x => x.ClientSpecific).KeyColumn("MainChapterId");
}
public MainChapterClientMap()
{
// other properties
References(x => x.MainChapter).Column("MainChapterId");
HasMany(x => x.Details).KeyColumn("MainChapterClientId");
}
public MainChapterClientDetailMap()
{
// other properties
References(x => x.MainChapterClient).Column("MainChapterClientId");
}
MainChapter
имеет много клиентов конкретных глав. Клиентский конкретные главы (MainChapterClient
) имеют много переводов (MainChapterClientDetail
)
Правило DELE должно быть следующим:
- При удалении
MainChapter
- Удалить
MainChapterClient
строку - Исключить
MainChapterClientDetail
ряд строк
- Удалить
- Когда dele тин
MainChapterClient
- НЕ удалить
MainChapter
строку - Удалить
MainChapterClientDetail
строку (ы)
- НЕ удалить
- При удалении
MainChapterClientDetail
- НЕ удалить
MainChapter
строку - ли НЕ удалить
MainChapterClientDetail
ряд (-ы)
- НЕ удалить
Но независимо от того, что я в конечном итоге получить эту ошибку:
deleted object would be re-saved by cascade (remove deleted object from associations)[Entities.MainChapterClient#39]
я не уверен, как настроить свои каскады больше. Любая помощь более чем приветствуется!
Благодаря это тоже помогло мне. –