数据库中存在CLOB字段,返回给前端报错500
Could not write JSON: Unsupported operation. SerialClob cannot return a the CLOB value as an ascii stream, unless instantiated with a fully implemented Clob object.; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unsupported operation. SerialClob cannot return a the CLOB value as an ascii stream, unless instantiated with a fully implemented Clob object.
解决办法:
在xml中的映射添加Java类型和JDBC类型的映射关系
javaType="string" jdbcType="CLOB"
例如:
< result property="content" column="content" javaType="string" jdbcType="CLOB"/>