Hi everyone! I'm working with NHibernate since few weeks ago, and I would like to create a 0..1:1 relationship (Persona vs UserInfo). I tried with one-to-one like this:
(Persona) <many-to-one name="ToUserInfo" class="SNG.Model.Authentication.UserInfo" column="UserInfoId" unique="true" cascade="all"/>
(UserInfo) one-to-one name="ToPersona" class="SNG.Model.Business.Persona" property-ref="ToUserInfo"/>
This is a typical one-to-one. But the database just let me insert one "Persona" with "UserInfoId" to NULL value. I think that this is caused by de "unique=true"....so I've tried to delete this, but then it works like a one-to-many relationship.
Is it possible to create this kind of relationship?
Thanks!
|