首页 > Web开发 > 详细

nhibernate 配置nvarchar(max)

时间:2015-05-27 18:45:00      阅读:588      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!