Looking at your DB schema it seems that you want to map one-to-one
association with a shared PK.
I can suggest the following solution which conform to your DB schema:
<class name="Osoba" table="Osoby">
<id name="IdOsoby">
<generator class="..." />
</id>
<property name="Email" />
<one-to-one name="DbLogin" cascade="save-update" />
</class>
<class name="DbLogin">
<id name="IdOsoby">
<generator class="foreign">
<param name="property">Osoba</param>
</generator>
</id>
<property name="UserName" not-null="true" />
<property name="Pwd" not-null="true" />
<one-to-one name="Osoba" constrained="true"/>
</class>
public class Osoba
{
public virtual int IdOsoby { get; private set; }
public virtual string Email { get; set; }
public virtual DbLogin DbLogin { get; set; }
}
public class DbLogin
{
public virtual int IdOsoby { get; private set; }
public virtual string UserName { get; set; }
public virtual string Pwd { get; set; }
public virtual Osoba Osoba { get; set; }
}
--
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.