我有一个关于mybatis注解和Oracle存储过程的问题
我的 mapper.xml 中有这个:
<mapper namespace="xyzname">
...
<select id="getDocument" parameterType="map" statementType="CALLABLE"><![CDATA[
{ #{OUT,javaType=jdl,jdbcType=CURSOR,mode=OUT} = call PKG.get_organisation_document (
#{ORGA_ID,javaType=java.lang.Long,jdbcType=NUMERIC,mode=IN},
#{PERSON_ID,javaType=java.lang.Long,jdbcType=NUMERIC,mode=IN},
#{GROUP_IDS,javaType=java.util.List,mode=IN,typeHandler=de.xyz.handlers.ArrayOfNumberTypeHandler},
#{TEMPLATE_IDS,javaType=java.util.List,mode=IN,typeHandler=de.xyz.handlers.ArrayOfNumberTypeHandler},
#{VALIDFROM,javaType=java.util.Date,jdbcType=TIMESTAMP,mode=IN},
#{VALIDUNTIL,javaType=java.util.Date,jdbcType=TIMESTAMP,mode=IN} ) }
]]></select>
...
</mapper>
它工作正常
现在我想用 mybatis 注释写这个
@Mapper
public interface PackageMapper {
@Select(value = " {#{OUT,javaType=java.sql.ResultSet,jdbcType=CURSOR,resultMap=documentData,mode=OUT} = call PKG.GET_ORGANISATION_DOCUMENT ("
+ "#{ORGA_ID,javaType=java.lang.Long,jdbcType=NUMERIC,mode=IN},"
+ "#{PERSON_ID,javaType=java.lang.Long,jdbcType=NUMERIC,mode=IN},"
+ "#{GROUP_IDS,typeHandler=de.xyz.handlers.ArrayOfNumberTypeHandler,javaType=java.util.List,jdbcType=ARRAY,mode=IN},"
+ "#{TEMPLATE_IDS,typeHandler=de.xyz.handlers.ArrayOfNumberTypeHandler,javaType=java.util.List,jdbcType=ARRAY,mode=IN},"
+ "#{VALIDFROM,javaType=java.util.Date,jdbcType=DATE,mode=IN},"
+ "#{VALIDUNTIL,javaType=java.util.Date,jdbcType=DATE,mode=IN}) }")
@Options(statementType = StatementType.CALLABLE)
public List<DocumentData> getDocument(Map<String, Object> params);
}
但我只得到 null 作为结果。
我的问题是:如何将一组 id 放入带有注释的存储过程中?我还能使用 Typehandlers 吗?