ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

SpringBoot4 MyBatisPlus JSON 类型

SpringBoot4 MyBatisPlus JSON 类型 SpringBoot4 MyBatisPlus JSON 类型前言新增 json 实体类ClientInfo 实体类调整 TBClient 实体类属性测试前言在此博文《SpringBoot4 MyBatisPlus 枚举类型enum》的基础上进行持续迭代功能开发。新增 json 实体类如下截图中TBClient 实体类中的属性 info 为String类型但存储的的是 josn 字符串。ClientInfo 实体类创建实体类后续进行映射TBClient.info中的 json 字符串。packagecom.junjiu.mybatisplus.entity;importlombok.Data;DatapublicclassClientInfo{// 年龄privateIntegerage;// 城市privateStringcity;// 性别privateStringgender;}调整 TBClient 实体类属性将TBClient.info中的属性由String类型修改为ClientInfo修改TableName注解属性测试运行测试结果如下可正常映射 json 属性。
返回列表