Nhibernate 如何进行插入、更新、删除
任何人都可以解释NHibernate在以下情况下的行为方式:
- 插入
- 更新
- 删除
如果父/子集合具有逆-非逆,级联,级联所有删除孤儿。
我想知道执行上述每种情况所遵循的规则。
提前致谢
Can anybody explain how NHibernate behave in case of:
- Insert
- Update
- Delete
in case if Parent/Child collection with inverss - non inverse , cascadea ll, cascade all delete orphan.
i want to know the rules that follow to execute each case of the above.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试看这里:
NHibernate Cascades:all、all-delete-orphans 和 save-update 之间的区别
或这里:
Nhibernate Cascade
也在这里:
NHibernate Definitive Cascade应用指南
更新
在这里您可以找到逆的精彩解释:
NHibernate 中的反向属性
这些是级联差异:
事务已提交,并且当对象传递给 save() 或
update() 并保存新实例化的瞬态实例并将更改保存到
分离的实例。
将对象传递给delete() 时的实例。
呼吁驱逐和锁定。
Hibernate 删除任何已被删除的持久实体实例
从关联(例如,从集合)(取消引用)。
已从关联中删除(取消引用)的实例(例如
例如,来自集合)。
Try look here:
NHibernate Cascades: the different between all, all-delete-orphans and save-update
or here:
Nhibernate Cascade
also here:
NHibernate Definitive Cascade application guide
update
Here you can find a great explanation of inverse:
Inverse Attribute in NHibernate
And those are cascade differences:
transaction is committed and when an object is passed to save() or
update() and save newly instantiated transient instances and persist changes to
detached instances.
instances when an object is passed to delete().
calls to evict and lock.
Hibernate deletes any persistent entity instance that has been removed
(dereferenced) from the association (for example, from a collection).
instance that has been removed (dereferenced) from the association (for
example, from a collection).