0

I am trying to read multiple cursor values in MyBatis and setting these values in DTO but getting an error. My SP returns 3 cursors and each cursor value I am trying to map with one DTO. Code follows

AccountDSSpMapper.xml

 <resultMap type="com.Role_Test" id="Role">
            <result property="roleID" column="Role_ID" />
            <result property="accountID" column="Account_ID" />
            <result property="roleName" column="Role_Name" />
            <result property="roleDesc" column="Description" />
 </resultMap>
 <resultMap type="com.Feature_Test" id="Feature">
            <result property="featureID" column="Feature_ID" />
            <result property="featureName" column="Feature_Name" />
 </resultMap>
  <resultMap type="com.Privilege_Test" id="Privilege">
            <result property="privilegeID" column="Privilege_ID" />
            <result property="privilegeName" column="Privilege_Name" />
 </resultMap>

 <select id="roleResults" resultMap="Role,Feature,Privilege" statementType="CALLABLE">
            { call Get_RoleDetails(#{accountID, mode=IN, jdbcType=INTEGER}, #{roleID, mode=IN,     jdbcType=INTEGER})}
 </select>

AccountDSSpMapper.java

 @MapKey("roleResults")
 public List<List<ArrayList<Object>>> getRoleDetails(Integer accountID, Integer roleID);

Exception - java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.AccountDSSpMapper.getRoleDetails

Can someone please suggest what's wrong here or correct way to deal with multiple cursor values in MyBatis.

Himanshu
  • 31,810
  • 31
  • 111
  • 133

1 Answers1

0

Got this working with

<select id="getRoleDetails" resultMap="Role,Feature,Privilege" statementType="CALLABLE">
        { call Get_RoleDetails(#{accountID, mode=IN, jdbcType=INTEGER}, #{roleID, mode=IN,         jdbcType=INTEGER})}
 </select>


 public List<List<ArrayList<Object>>> getRoleDetails(Integer accountID, Integer roleID);