How to write a CLOB type (${Parameter} Column Name) in the resultMap.

44 views
Skip to first unread message

진채은

unread,
Mar 5, 2023, 8:32:52 PM3/5/23
to mybatis-user
Hi. There!
Please tell me how to write a CLOB type ${Parameter} Column Name in the resultMap.

I Want..
1) Can Column be writed when some names match in resultMap?
or 
2)  Can I get the parameter value in the resultMap?
or
3) How to Disable ResultMap?

XML2CLOB makes the element CLOB type. (DB2)

parameter 
<resultMap type="HashMap" id="ClobToString">
<result property="${paramter}_NAME" column="${paramter}_NAME" JdbcType="CLOB" javaType="java.lang.String" />
</resultMap>

<select id="" resultType="HashMap" resultMap="ClobToString">
SELECT 
A.id
<foreach collection="parameter" item="item">
, XML2CLOB(...) AS ${parameter}_NUMBER
XML2CLOB() AS ${parameter}_NAME
, ...
</foreach>
FROM Table A 
<foreach collection="parameter" item="item">
LEFT JOIN B ${item}  ON A.id = ${item}.id AND ${item}.area = #{item} 
</foreach>
</select>


Thank you in advance.
Reply all
Reply to author
Forward
0 new messages