Parameter cannot be null error after success save

Posted by tigermain on Stack Overflow See other posts from Stack Overflow or by tigermain
Published on 2010-05-08T13:56:52Z Indexed on 2010/05/08 13:58 UTC
Read the original article Hit count: 289

Filed under:
|
|
|

I am getting the following nhibernate error when saving an entity (via: NHibernateSession.Save(entity);) despite it being persisted to the database fine

"Value cannot be null.\r\nParameter name: id"

This is my hbm file

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="JeanieMaster.Domain.Entities" assembly="JeanieMaster.Domain">
  <class name="ActionLog" table="ActionLog" schema="[DBSVR1].[mydatabase].[dbo]" select-before-update="false" optimistic-lock="none">
    <id name="Id" column="ActionLogId" type="Int32">
      <generator class="identity"/>
    </id>

    <property name="ActionId"   type="Int32"/>

    <many-to-one name="User" class="JeanieUser" column="UserId" />
    <many-to-one name="ApplicationProvider" class="ApplicationProvider" column="ApplicationProviderId" />
    <many-to-one name="ContentProvider" class="ContentProvider" column="ContentProviderId" />
    <many-to-one name="SearchLog" class="SearchLog" column="SearchLogId" />

    <property name="Data"   type="string"/>

    <property name="DateCreated"    type="DateTime"/>
    <property name="ActionDuration" type="Double"/>

  </class>
</hibernate-mapping>

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about sql