如果直接更新clob会报错,需要特殊写法,如下:
新建mapper
public interface MyClobMapper {
int updateReportSummary(@Param("id") Long id, @Param("reportSummary") String reportSummary);
}
新建mapper xml
<update id="updateReportSummary" parameterType="map">
update my_clob
set report_summary = #{reportSummary, jdbcType=CLOB, typeHandler=org.apache.ibatis.type.ClobTypeHandler}
where id = #{id}
</update>
重点就在xml中的写法!!!