我正在尝试在MyBatis中读取多个光标值并在DTO中设置这些值但是会出错。我的SP返回3个游标和我试图用一个DTO映射的每个游标值。代码如下
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);
异常 - java.lang.IllegalArgumentException:映射语句 集合不包含值 com.AccountDSSpMapper.getRoleDetails
有人可以在这里建议这里有什么问题或者在MyBatis中处理多个游标值的正确方法。
答案 0 :(得分:0)
使用
<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);