I am getting this error and have no idea how to fix it. Below is my
mapping file.

This error occurs when I try to insert a new value to the table
"SamplerReading"

////////////SAMPLER READING MAPPING
FILE///////////////////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="GEMSystem"
                   namespace="GEMSystem.Models.Entities">

  <class name="SamplerReading" table="SAMPLERREADING">
    <id name="ReadingId" column ="READINGID" type ="int">
      <generator class="increment"/>
    </id>

    <property name="Alphanum" column="ALPHANUM"></property>
    <property name="Ph" column="PH"></property>
    <property name="Ec" column="EC"></property>
    <property name="Chromium" column="CHROMIUM"></property>
    <property name="Fluoride" column="FLUORIDE"></property>
    <property name="OilAndGrease" column="OILANDGREASE"></property>
    <property name="Temperature" column="TEMPERATURE"></property>
    <property name="Arsenic" column="ARSENIC"></property>
    <property name="DepthToCollar" column="DEPTHTOCOLLAR"></property>
    <property name="SamplingDate" column="SAMPLINGDATE"></property>
    <property name="LabId" column="LABID"></property>

    <many-to-one name="Sampler" class="Sampler" column="ALPHANUM"
cascade="none"/>
    <many-to-one name="Laboratory" class="Laboratory" column="LABID"
cascade="none"/>

  </class>
</hibernate-mapping>

///////////////////SAMPLER MAPPING
FILE///////////////////////////////////////////////////////////////////////////////////
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="GEMSystem" namespace="GEMSystem.Models.Entities">
  <class name="Sampler" table="SAMPLER" lazy="false">
    <id name="Alphanum" column="ALPHANUM">
      <generator class="assigned" />
    </id>
    <property name="LicenseNo" column="LICENSENO"/>
    <property name="Type" column="SAMPLERTYPE" />
    <property name="Longitude" column="LONGITUDE" />
    <property name="Latitude" column="LATITUDE" />
    <property name="MonitoringDescription" column="MONITORINGDESC" />
    <property name="CSFrequency" column="CSFREQUENCY" />
    <property name="SSFrequency" column="SSFREQUENCY" />
    <property name="DTCFrequency" column="DTCFREQUENCY" />
    <property name="WaterBodyId" column ="WATERBODYID"/>
    <set name="MediaFiles" cascade="save-update">
      <key column="ALPHANUM" /> <!-- foreign key-->
      <one-to-many class="MediaFile"/>
    </set>
    <many-to-one name="WaterBody" class="WaterBody"
column="WATERBODYID" cascade="none" />

    <set name="SamplerReadings" cascade="save-update">
      <key column ="ALPHANUM" />
      <one-to-many class="SamplerReading"/>
    </set>

    <set name="SamplerAssignments" cascade="save-update">
      <key column ="ALPHANUM" />
      <one-to-many class="SamplerAssignment"/>
    </set>

  </class>

</hibernate-mapping>

-- 
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.

Reply via email to