nhibernate 配置nvarchar(max)

 若你真的需要一个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.
原文地址:https://www.cnblogs.com/zhtbk/p/4534064.html