I have looked at a number of StackOverflow questions on this issue but can't find one that makes any sense. This one comes closest but doesn't show how to get the return value from the function.
Here's my mapper call:
public Long callMyFunction(@Param("recordId") Long recordId, @Param("otherId") Long otherId, @Param("date") Date date, @Param("comments") String comments);
Here's the mapper XML:
<select id="callMyFunction" parameterType="map" statementType="CALLABLE" resultType="java.lang.Long">
{ #{resultId,javaType=java.lang.Long,jdbcType=NUMERIC,mode=OUT} = call MYSCHEMA.MYPACKAGE.my_function(
#{recordId,jdbcType=NUMERIC,mode=IN},
#{otherId,jdbcType=NUMERIC,mode=IN},
#{date,jdbcType=DATE,mode=IN},
#{comments,jdbcType=VARCHAR,mode=IN})}
</select>
The call works, but the return value (resultId) is always null.
Can anybody spot the problem?