C# 错误:22001:值太长,无法更改类型字符(255)
那里!我正在使用PostgreSQL+NHibernate。映射文件中有4个字段:C# 错误:22001:值太长,无法更改类型字符(255),c#,postgresql,nhibernate,nhibernate-mapping,C#,Postgresql,Nhibernate,Nhibernate Mapping,那里!我正在使用PostgreSQL+NHibernate。映射文件中有4个字段: <property name="Name" not-null="false" type="String"/> <property name="Include" not-null="false" type="String"/> <property name="Exclude" not-null="false" type="String"/> 当我编译代码时,数据库中有许多插
<property name="Name" not-null="false" type="String"/>
<property name="Include" not-null="false" type="String"/>
<property name="Exclude" not-null="false" type="String"/>
当我编译代码时,数据库中有许多插入查询。PostgreSQL给了我这个错误
“错误:22001:值太长,无法更改类型字符(255)”
我知道PostgreSQL存储数据的功能中有“文本”类型。如何让NHibernate为我的字段提供“文本”类型?我找到了解决方案!我应该将映射字段定义为:
<property name="Name" not-null="false" type="StringClob"/>
<property name="Include" not-null="false" type="StringClob"/>
<property name="Exclude" not-null="false" type="StringClob"/>