Hi,
I'm trying to save an entity of type Post which contains a property CreatedBy of type SimplePerson. Here's the relevant mapping :
Code:
<many-to-one name="CreatedBy" class="Metrica.SimplePerson,Metrica" column="CreatedBy" cascade="merge" />
When I call
Code:
SessionManager.GetCurrentSession().Merge(pPost);
I get the following exception :
object references an unsaved transient instance - save the transient instance before flushing: Metrica.SimplePerson
I believe it is related to the fact that the SimplePerson associated to the Post I'm trying to save is null (in my database the field CreatedBy is nullable). How can I configure the mapping so that I can save my Post whether SimplePerson is null or not ?
Thanks