1.首先在对应表添加一个json
类型字段
2.在java对应的实体类添加对应的字段,重点是加上(typeHandler = JacksonTypeHandler.class)
这个注解
不然的话保存会报如下错Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'urlParams'. It was either not specified and/or could not be found for the javaType (com.alibaba.fastjson.JSONObject) : jdbcType (null) combination.
3.mybatisPlus
查询json
类型数据结果为null
,这个得在@TableName
加上autoResultMap = true
注解
来源地址:https://blog.csdn.net/weixin_44729970/article/details/129141353