Hi,
I have a one-directional relation between Product -> Comments (bag,
with inverse=true), the Comment domain entity has no property
reference back to the Product. The problem is that the foreign-key
ProductId is not included in the insert of comment. If I set the
inverse=false the ProductId is set in an subsequent update (not in the
insert).
Is this a bug or is simply nhibernate not currently able to handle
this scenario? That is include the foreign-key that is set on the
parent mapping in insert statements
( ForeignKeyDirection.ForeignKeyFromParent)
Mapping:
<class name="Product" table="Product">
<id name="Id">
<generator class="guid.comb" />
</id>
<bag name="Comments" cascade="all-delete-orphan" lazy="false"
inverse="true">
<key column="ProductId" not-null="true" />
<one-to-many class="Comment" />
</bag>
</class>
<class name="Comment" table="Comment">
<id name="Id">
<generator class="guid.comb" />
</id>
<property name="Name" />
</class>
Best Regards
Torkel
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---