mybatis plus实体类中字段映射mysql中的json格式
时间:2020-06-13 19:51:27
收藏:0
阅读:1403
1.实体类中有个属性是其他对象,或者是List;在数据库中存储时使用的是mysql的json格式,此时可以用mybatis plus的一个注解@TableField(typeHandler = JacksonTypeHandler.class)
这样在存入是就可以把对象自动转换为json格式,
2.那么取出时怎么进行映射呢,有分为两种情况
? a:当没有使用到xml时:
? b:当使用了xml文件时:
原文:https://www.cnblogs.com/changchangchang/p/13121407.html
评论(0)