<select id="selectByAllCondition" parameterType="News" resultMap="News">
select * from yg_news order by pubtime desc
</select>
设置返回结果集,指定数据库类型CLOB
<resultMap type="com.yg.entity.News" id="News">
<result property="content" column="content" javaType="java.lang.String" jdbcType="CLOB"/>
</resultMap>
select * from yg_news order by pubtime desc
</select>
设置返回结果集,指定数据库类型CLOB
<resultMap type="com.yg.entity.News" id="News">
<result property="content" column="content" javaType="java.lang.String" jdbcType="CLOB"/>
</resultMap>
本文介绍了一种使用MyBatis处理数据库CLOB类型的方案,通过定义resultMap映射来实现将CLOB类型的数据正确地映射到Java String类型。此方法适用于新闻等内容管理系统中文章内容的读取。
4789

被折叠的 条评论
为什么被折叠?



