首页 > 移动平台 > 详细

The length of the string value exceeds the length configured in the mapping/parameter.

时间:2014-04-24 11:29:32      阅读:704      评论:0      收藏:0      [点我收藏+]

在NHibernate 3.3 中存储的字符串太长,会抛异常:The length of the string value exceeds the length configured in the mapping/parameter.

有人会说这是新版NHibernate的一个Bug,3.2就不会出现这样的情况。实际上,对于string类型的属性值,NHibernate默认值最大值是4000个字符,在3.2中会自动截断,在3.3中会给你抛一个异常出来,所以这并不是一个Bug,如果你想存储超过4000个字符的字符串,请在映射文件中修改该属性的类型,使用 type="StringClob" 

<property name="myProp" column="MY_PROP" not-null="true" type="StringClob" access="property"></property>  

Or

Map(x => x.Description).CustomType("StringClob").CustomSqlType("nvarchar(max)");

 

The length of the string value exceeds the length configured in the mapping/parameter.,布布扣,bubuko.com

The length of the string value exceeds the length configured in the mapping/parameter.

原文:http://www.cnblogs.com/vincentDr/p/3683348.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!