如何在NHibernate 3.2中按代码映射将整个映射设置为只读? [英] How to set entire mapping to read only in NHibernate 3.2 mapping-by-code?

查看:95
本文介绍了如何在NHibernate 3.2中按代码映射将整个映射设置为只读?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用NHibernate 3.2及其按代码映射"功能,并将我们的Fluent映射迁移到它上. 是否有相当于流利的"ReadOnly();"的等效项?函数,以使整个映射为只读? 预先感谢.

I'm just getting up to speed with NHibernate 3.2 and its "mapping by code" feature, and migrating our Fluent mapping over to it. Is there an equivalent of the fluent "ReadOnly();" function, to make the entire mapping read only? Thanks in advance.

推荐答案

在映射中使用Mutable(false).

Use Mutable(false) in the mapping.

从这篇文章中可以推断出相应的hbm文件映射.

Read this post for corresponding hbm file mapping from where I could infer this.

http://davybrion.com/blog/2007 /08/read-only-data-in-nhibernate/

这篇关于如何在NHibernate 3.2中按代码映射将整个映射设置为只读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆