nhibernate - 适当映射字符串字段长度(按代码映射)

标签 nhibernate nhibernate-mapping

如何将字符串字段长度映射到 sql 中的 nvarchar(max)
服务器?

Property<string>(x => x.Content, x => x.Length(Int32.MaxValue));

它导致仅映射到 nvarchar(255)。

最佳答案

Property(x => x.Content, x => x.Type(NHibernateUtil.StringClob))

关于nhibernate - 适当映射字符串字段长度(按代码映射),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6643597/

相关文章:

NHibernate.PropertyValueException : not-null property references a null or transient

c# - nhibernate 不级联删除 child

NHibernate 不会创建代理,除非 class...lazy=true

c# - CaSTLe Active Record 多个数据库连接(Oracle 和 SQL)

c# - 使用 QueryOver 如何针对 "is in"编写 Where 语句

.net - 是一对一还是组件?休眠映射

NHibernate fetch ="join"映射属性似乎不起作用

c# - NHibernate 工作单元 - 多 session (WinForms)

c# - NHibernate 映射 - 一对一(或一对零)

Nhibernate HQL where IN 查询