nHibernate 映射问题 - 无法删除集合的成员
好的。 所以情况是:
父类有一个子类的 IDictionary。 我希望当父类删除时这些子类也被删除。 这很好用。 我还希望能够单独删除子类的成员,但这不起作用。
所以我的问题是; 为什么我无法删除这些子成员?
我得到的错误是这样的:
无法删除,会级联读取
我的父类中的映射文件具有“all-delete-orphan”的级联设置,而子类没有定义级联。
任何想法? 干杯。
Ok. So the situation is:
Parent Class which has an IDictionary of Child Classes. I wish these child classes to be deleted when the parent class is. This works fine. I also wish to be able to delete members of the child class individually, and this does NOT work.
So my Question is; Why can I not delete these child members?
The error I get is along the lines of:
Cannot delete, Would be readded by cascade
My mapping file in the parent class has a cascade setting of 'all-delete-orphan' while the child class has no cascading defined.
Any idea? Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看映射会很有帮助。 但我的猜测是,除了删除子项之外,您还没有从父项的集合中删除子项。
It would be helpful to see the mappings. But my guess is that you are not removing the child from the parent's collection in addition to deleting it.