Hi guys,
I'm having an issue with nHibernate 2.0 when using one-to-one
relationships between two objects. Here are the mappings:
<class name="TimeReport" table="TimeReport" lazy="false">
...
<one-to-one name="Timesheet" class="Timesheet" lazy="proxy"
cascade="all"/>
...
</class>
<class name="Timesheet" table="Timesheet" lazy="false">
...
<one-to-one name="TimeReport" class="TimeReport"
constrained="true" cascade="none"/>
...
</class>
The problem happens when I try to save a TimeReport object that
contains the timesheet. The inserts work perfectly, but after that,
the application causes two updates to be executed:
INSERT INTO TimeReport...
INSERT INTO Timesheet...
UPDATE TimeReport ... (no data changes)
UPDATE Timesheet ... (no data changes)
This looks very similar to the "inverse=true" problem with sets and
bags, but I don't understand why this would happen with one-to-one
relationships. Would anybody have any ideas on how to fix this?
This issue did not occur in nHibernate 1.2.
Thanks!
--
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=.