I need to return a value from a PL / SQL block in MyBatis.
PL / SQL block:
DECLARE BEGIN <foreach collection="params" item="param"> UPDATE PRIORITIES SET PRIORITY =
The reason I need to return the value is because I want to get the number of rows affected.
I know I can do it like this:
<update id="updateAll" parameterType="map"> { call DECLARE BEGIN <foreach collection="params" item="param"> UPDATE PRIORITIES SET PRIORITY = #{param.priority} WHERE ID = #{param.id}; </foreach> #{affected_rows, jdbcType=DECIMAL, mode=OUT} := sql%rowcount; END } </update>
But this means that I should have such a method in a java translator:
public void updateAll(Map<String, String> parameters);
I have this instead:
public int updateAll(@Param("params") List<PriorityModel> model);
Is there any way to return this value without a card?
source share