Hello. I am attempting to call a Sql Server stored procedure from
iBATIS (.NET version) and pass a hashtable as the parameter collection.
The call always returns null. Here is my mapping:
<statements>
<procedure id="selectPersonProc"
parameterMap="selectPersonParams" resultMap="selectPersonResultMap">
Person_Read_StoredProc
</procedure>
</statements>
<parameterMaps>
<parameterMap id="selectPersonParams" class="map">
<parameter property="ID" column="ID"/>
</parameterMap>
</parameterMaps>
<resultMaps>
<resultMap id="selectPersonResultMap" class="Person">
<result property="Id" column="ID"/>
<result property="FirstName"
column="FirstName"/>
<result property="MiddleName"
column="MiddleName"/>
<result property="LastName" column="LastName"/>
</resultMap>
</resultMaps>
And here is the implementation:
Hashtable parameters = new Hashtable();
parameters.Add("ID", 12345);
return
Mapper.Instance().QueryForObject<Person>("selectPersonProc",
parameters);
I have tried "System.Collections.Hashtable",
"System.Collections.IDictionary", "hashmap" and "map" for the
parameterMap class, but nothing seems to work. Any help would be
greatly appreciated!