Guys,
As the title says, i have a mapping issue. I have tried to condense
the issue into a contrived example as follows.
I have:
1) A Person entity with a PersonKey primary key.
2) An Attribute entity with a reference to Person (has a PersonKey
foreign key).
3) A Race entity that is a joined subclass of the Attribute entity.
4) The Person entity has an IList of Race entities (a Races property).
The problem is that nhibernate doesn't seem to recognize that Race
will inherit the PersonKey from Attribute. In the sql generation it
wants to add a PersonKey column to Race. Also, when I access the
Races property of Person, the lazy load mechanism kicks in tries to
query the list of Race entities by accessing Race.PersonKey, which,
again should come from the Attribute class.
Any help would be greatly appreciated.
------------------------------
Additional Information:
The Person mapping:
<class name="Person" table="Person">
<id name="Key" ....
<column name="PersonKey" />
...
</id>
<bag inverse="true" name="IntoleranceConditions">
<key>
<column name="PersonKey" />
</key>
<one-to-many class="Race" />
</bag>
</class>
The Attribute and Race Mappings:
<class name="Attribute" table="Attribute">
<id name="Key" ...
<column name="AttributeKey" />
...
</id>
<joined-subclass name="Race">
<key foreign-key="Foo_FK">
<column name="AttributeKey" />
</key>
</joined-subclass>
</class>
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.