NHibernate 中的逆和级联是什么意思 [英] what does inverse and cascade means in NHibernate
问题描述
我正在学习 Fluent Nhibernate,我的问题是:Inverse
是什么意思?我读到这意味着关系的另一方负责保存,Cascade
也是如此,
I'm learning Fluent Nhibernate and my question is:
What does Inverse
mean? I read that it means that the other side of the relationship is responsible for the saving, and so does Cascade
,
有人可以解释一下它们之间有什么区别吗?请详细解释,因为我是NH的新手.
Can someone please explain what are the differences between them? Please explain in details because I'm a newbie at NH.
推荐答案
当 Inverse = false 是必要时,我找到了一个解释.如果我想要一个带有孩子"集合的父对象,并且在子对象中不会有对父级的引用.
所以你在父级上有很多添加 inverse = false 而不是在子级中添加引用.
I found an explanation when Inverse = false is necessary.
If I want a Parent with collection of "children" and in the child object there won't be
a reference to the parent.
so you do Has many on the parent add inverse = false and not adding the reference in the child.
这篇关于NHibernate 中的逆和级联是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!