Mybatis操作Clob字段

最近在项目中需要用到Mybatis操作Clob字段

发现原来mybatis已经提供了 ClobTypeHandler 和  BlobTypeHandler 等工具类可供使用.

用起来真的 so easy

 
<resultMap id="testMap" type="com.test.TestVO">
   <result  column="news" property="news" typeHandler="org.apache.ibatis.type.ClobTypeHandler"/>
</resultMap>

<select id="id" resultMap="testMap">
  select news from table_name where id = xxx
</select>

猜你喜欢

转载自yxjajl.iteye.com/blog/2358393
今日推荐