尧图精选

SpringBoot4 MyBatisPlus JSON 类型

🕒 发布时间:2026/10/27 1:53:16 📁 来源:尧图网络
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 属性。
上一篇/下一篇内容由系统自动关联 返回资讯列表 →