【发布时间】:2011-10-01 21:22:22
【问题描述】:
我在 MS SQL Server 2008(设置 MsSql2008Dialect)中使用休闲 NHibernate 映射 (NH 3.2):
<class name="Layout" table="Layout" lazy="false" >
<cache usage="read-write"/>
<id name="Id" column="Id" type="Guid">
<generator class="assigned"/>
</id>
<version name="ObjectVersion" column="ObjectVersion"/>
<property name="Key" column="Key" type="String" length="255" not-null="true" />
<property name="Value" column="Value" type="BinaryBlob" length="2147483647" />
<property name="Created" column="Created" type="Timestamp" not-null="true" optimistic-lock="false" />
<property name="CreatedBy" column="CreatedBy" type="String" length="255" not-null="true" optimistic-lock="false" />
<property name="Changed" column="Changed" type="Timestamp" optimistic-lock="false" />
<property name="ChangedBy" column="ChangedBy" type="String" length="255" optimistic-lock="false" />
<many-to-one name="User" class="User" foreign-key="FK_User_Layout" lazy="proxy" fetch="select">
<column name="UserId"/>
</many-to-one>
</class>
问题就在这里,对于列值,NHibernate 将创建一个 IMAGE 字段。但我需要 VarBinary(max)。映射有什么问题?
【问题讨论】:
标签: nhibernate sql-server-2008 nhibernate-mapping