I am also having this problem, I have a one-to-one relationship using the 'unique foreign key associations' example in the documentation.
The problem is if one of the records do not exist, it causes an exception
Code:
No row with the given identifier exists: fffdc40c-2233-4064-8ad2-c9d831071f94, of class: FusionRecruit.AspNetProviders.Pocos.AspNetProfile
My mapping (stripping out columns not needed):
Code:
<class name="FusionRecruit.AspNetProviders.Pocos.AspNetUser, FusionRecruit.AspNetProviders" table="aspnet_Users">
<id name="UserId" column="UserId">
<generator class="guid" />
</id>
<many-to-one name="Profile" class="FusionRecruit.AspNetProviders.Pocos.AspNetProfile, FusionRecruit.AspNetProviders" column="UserId"
unique="true" insert="false" update="false"
cascade="all" not-null="false" />
</class>
<class name="FusionRecruit.AspNetProviders.Pocos.AspNetProfile, FusionRecruit.AspNetProviders" table="aspnet_Profile">
<id name="UserId" column="UserId">
<generator class="foreign">
<param name="property">User</param>
</generator>
</id>
<one-to-one name="User" class="FusionRecruit.AspNetProviders.Pocos.AspNetUser, FusionRecruit.AspNetProviders" constrained="true" />
</class>
Ideally I want it so the AspNetUser either has a profile or doesn't have one, a one-to-zero-or-one relationship.
Anyone know how to get around this issue?
best regards
Fluxtah