views:

64

answers:

0

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.Parameter name: id"

This is my hbm file

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="mydatabase.Domain.Entities" assembly="mydatabase.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>