Invalid index 12 for this OracleParameterCollection with Count=12.

989 views
Skip to first unread message

Damien Koh

unread,
Sep 22, 2010, 8:40:55 AM9/22/10
to nhusers
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>

Fabio Maulo

unread,
Sep 22, 2010, 12:07:32 PM9/22/10
to nhu...@googlegroups.com
Duplicated column name LABID


--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.




--
Fabio Maulo

Diego Mijelshon

unread,
Sep 22, 2010, 12:36:06 PM9/22/10
to nhu...@googlegroups.com
And ALPHANUM
 
    Diego
Reply all
Reply to author
Forward
0 new messages