码迷,mamicode.com
首页 > Web开发 > 详细

nhibernate 配置nvarchar(max)

时间:2015-05-27 18:46:48      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

 若你真的需要一个nvarchar(max)的sql存储空间时,记得增加 .CustomType("StringClob")

Demo:
Map(x => x.ContentManifest).CustomType("StringClob").CustomSqlType("nvarchar(max)");
 
Map(x => x.ContentManifest).lenght(10000);
 
这两种方式都行

尽管只用CustomSqlType("nvarchar(max)") 可以在DB中映射出nvarchar(max),但使用中hibernate默认为4000字符  超出将提示  The length of the string value exceeds the length configured in the mapping/parameter.

nhibernate 配置nvarchar(max)

标签:

原文地址:http://www.cnblogs.com/zhtbk/p/4534064.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!