I have the following exception:
{"Invalid index 4 for this OracleParameterCollection with Count=4."}
it happens when I try to insert an object configured like this:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="ConsoleApplication2.DAO.Step, ConsoleApplication2" table="TE_STEP">
<composite-id name="Key" class="ConsoleApplication2.DAO.StepKey, ConsoleApplication2">
<key-property name="Id" column="StepId"/>
<key-property name="TId" column="TaskId"/>
</composite-id>
<version name="_version" column="GuidStamp" type="Int16" access="field" unsaved-value="0" generated="never"/>
<property name="Description" column="StepDesc" type="String" length="150"/>
<many-to-one name="Task" class="ConsoleApplication2.DAO.Task, ConsoleApplication2" column="TaskId"/>
<set name="Activities" cascade="all" lazy="true">
<key>
<column name="StepId"/>
<column name="TaskId"/>
</key>
<one-to-many class="ConsoleApplication2.DAO.Activity, ConsoleApplication2"/>
</set>
</class>
</hibernate-mapping>
and the exception raises at:
protected int Dehydrate(object id, object[] fields, object rowId, bool[] includeProperty, bool[][] includeColumns, int table,
IDbCommand statement, ISessionImplementor session, int index)
it seems that's miscounting the params, because:
1) sql: "INSERT INTO DBO.TE_STEP (GuidStamp, StepDesc, StepId, TaskId) VALUES (:p0, :p1, :p2, :p3)"
2) assignation of PKs (with index badly set at 3)
.
.
.
else if (id != null)
{
IdentifierType.NullSafeSet(statement, id, index, session); <---- FAILS HERE!!!
index += IdentifierColumnSpan;
}
and then try to set the compositeid at 3 and 4 (error!!)
Any help/suggestions with this???
Thanks
Mauro
|