私はフィールドを持つメンバー表を持って
MemID同じ会員テーブル。私は、このようなメンバークラスをマッピングすることができると思ったが、私は「System.Collections.Generic.KeyNotFoundExceptionを取得
EmployerName
EmployerAddress
EmployerPhoneフィールドからNHibernateのマッピングエンティティ
ここでは、私の雇用マッピング
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true">
<class name="Employer, Entities" lazy="true" table="Members" dynamic-update="true">
<id name="MemberID" column="MemID" type="Int64">
<generator class="native" />
</id>
<many-to-one name="EmployerAddress" column="Business_Address" class="Address, Entities" lazy="proxy" />
<many-to-one name="EmployerPhone" column="Business_Phone" class="Phone, Entities" lazy="proxy"/>
<property name="EmployerName" column="Business_Name" not-null="false" />
</class>
</hibernate-mapping>
次のとおりです。指定されたキーが辞書に存在しませんでした。
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" auto-import="true">
<class name="Member, Entities" lazy="true" table="Members" dynamic-update="true">
<id name="MemberID" column="MemID" type="Int64">
<generator class="native" />
</id>
<one-to-one name="EmployerInformation" class="Employer, Entities" lazy="false"/>
</class>
</hibernate-mapping>
もご注意ください。現在のシステムの制約のために、ビジネス情報を別のテーブルに移動することはできません。 Business_AddressとBusiness_Phoneは別のテーブルへのFKであるため、多対1のマッピングです。
私の問題を解決してくれてありがとう! – Adam
素晴らしい、私は助けてうれしい! –