最近、プロジェクトをバージョン1.3.0.717および3.2.0.4000からNuGetを介してFNH1.3.0.727およびNH3.3.0.4000に更新しました。自動マップを使用すると、更新前に生成されたXMLは次のようになります。
<class xmlns="urn:nhibernate-mapping-2.2" name="APP.Domain.Module, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="Module">
<id name="Id" type="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="ModuleId" />
<generator class="guid.comb" />
</id>
<many-to-one class="APP.Domain.Product, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Product">
<column name="ProductId" />
</many-to-one>
<joined-subclass name="APP.Domain.Audit.Trail, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<key>
<column name="TrailId" />
</key>
<bag cascade="all" inverse="true" lazy="true" name="Arguments">
<key>
<column name="TrailId" />
</key>
<one-to-many class="APP.Domain.Audit.Argument, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>
<property name="Action" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Action" />
</property>
<property name="Date" type="System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Date" />
</property>
<property name="Workflow" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Workflow" />
</property>
<property name="Identity" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="[Identity]" />
</property>
</joined-subclass>
</class>
および更新後:
<class xmlns="urn:nhibernate-mapping-2.2" name="APP.Domain.Module, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="`Module`">
<id name="Id" type="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="ModuleId" />
<generator class="guid.comb" />
</id>
<many-to-one class="APP.Domain.Product, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="Product">
<column name="ProductId" />
</many-to-one>
<joined-subclass name="APP.Domain.Audit.Trail, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<key>
<column name="TrailId" />
<column name="ModuleId" />
</key>
<bag cascade="all" inverse="true" lazy="true" name="Arguments">
<key>
<column name="TrailId" />
<column name="TrailId" />
</key>
<one-to-many class="APP.Domain.Audit.Argument, APP.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bag>
<property name="Name" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Name" />
</property>
<property name="Date" type="System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Date" />
</property>
<property name="Workflow" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="Workflow" />
</property>
<property name="Identity" type="System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<column name="[Identity]" />
</property>
</joined-subclass>
</class>
私のモデルには複合キーがなく、すべてが正しかったので、例外が発生し"Foreign key (FK4B9386BFF4D27734:Argument [TrailId])) must have same number of columns as the referenced primary key (Trail [TrailId, ModuleId])"
ました。
新しいバージョンに何か足りないものはありますか?