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
注解
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END