mytbatis mapper.xml报错:java.lang.UnsupportedOperationException] with root cause
Cause: java.lang.UnsupportedOperationException] with root cause java.lang.UnsupportedOperationException: null
mapper层接口
List selectRolePredict(@Param("organId") String organId,@Param("businessId") String businessId);
mybatis.xml sql结构
<select id="selectRolePredict" resultType="list">
select DISTINCT next_approval_role from business_node_approval_role
<where>
organ_id=#{
organId} and business_id=#{
businessId} and !isnull(next_approval_role)
</where>
</select>
解决方法:把resultType=“java.util.List” 改为String
原因:
resultType返回的是集合中的元素类型,而不是集合本身
<select id="selectRolePredict" resultType="string">
select DISTINCT next_approval_role from business_node_approval_role
<where>
organ_id=#{
organId} and business_id=#{
businessId} and !isnull(next_approval_role)
</where>
</select>
修改之后重新启动项目再次测试接口
解决
还没有评论,来说两句吧...