转:NHibernate和SqlImage
时间:2011-02-23 来源:江水
Table 5.5. Large Object Mapping Types
NHibernate Type | .NET Type | Database Type | Remarks |
---|---|---|---|
StringClob | System.String | DbType.String | type="StringClob" must be specified. Entire field is read into memory. |
BinaryBlob | System.Byte[] | DbType.Binary | type="BinaryBlob" must be specified. Entire field is read into memory. |
Serializable | Any System.Object that is marked with SerializableAttribute. | DbType.Binary | type="Serializable" should be specified. This is the fallback type if no NHibernate Type can be found for the Property. |
原hbm.xml
<property name="NH_FileContent" type="byte[]">
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
</property> 改为
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
</property> 改为
<property name="NH_FileContent" type="BinaryBlob">
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
</property>
.net中的类型不用改
<column name="FileContent" length="2147483647" sql-type="image" not-null="false"/>
</property>
.net中的类型不用改
此内容来自http://hi.baidu.com/zhanglin34/blog/item/03ac5e9558f6514cd0135e39.html
相关阅读 更多 +