.net - 休眠级联

标签 .net nhibernate orm cascade

什么级联Nhibernate意思?

我在级联中看到了很多选项:

  • 删除
  • 全部
  • AllDeleteOrphan
  • 删除孤儿
  • 保存更新

  • 你能用例子和它们的区别来解释这些吗?

    最佳答案

    这意味着将操作应用于项目的相关项目。

    请参阅:NHibernate Cascades: the different between all, all-delete-orphans and save-update :

    • none - do not do any cascades, let users handle them by themselves.

    • save-update - when the object is saved/updated, check the associations and save/update any object that requires it (including save/update the associations in many-to-many scenario).

    • delete - when the object is deleted, delete all the objects in the association.

    • delete-orphan - when the object is deleted, delete all the objects in the association. In addition, when an object is removed from the association and not associated with another object (orphaned), also delete it.

    • all - when an object is save/update/delete, check the associations and save/update/delete all the objects found.

    • all-delete-orphan - when an object is save/update/delete, check the associations and save/update/delete all the objects found. In additional to that, when an object is removed from the association and not associated with another object (orphaned), also delete it.

    关于.net - 休眠级联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1994433/

    相关文章:

    nhibernate - 如何在 NHibernate 中使用左连接查询实现分页

    orm - 无法使用Beego的ORM .All()

    java - 如何在mybatis中的IN子句中使用超过1000个参数?

    java - Hibernate 中作为复合标识符的组件

    c# - 使用 System.IO.Compression 验证 zip 文件

    c# - 使每个 block 内的更改持久化

    NHibernate.Caches.EnyimMemcached,protobuf-net.Enyim 想要 Enyim.Caching 的冲突版本

    c# - 为什么必须最后指定 new() 约束?

    c# - NLog - 同时抛出异常和日志消息

    NHibernate 多线程问题