Java后端使用POST请求向mysql中插入Json数据的问题

1.后端请求正常 但数据表中value没有值

bash 复制代码
原因 json数据属性不符合spring解析格式,json属性名称的大写字母不符合spring要求
以下为为错误示范 
1 Test 以大写字母开头,
2 tTest 小写字母开头,但是第二个字母是大写

解决方案 实体类属性加上@JsonPropert

2.Type handler was null on parameter mapping for property 'data'. It was either not specified and/or could not be found for the javaType (java.util.List) : jdbcType (null) combination.] with root cause

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.

bash 复制代码
在实体列表属性加上以下注解
@TableField(typeHandler = JacksonTypeHandler.class)
判定json 以排除其为null的可能性

3.mp不能直接读取json

bash 复制代码
在实体加上@TableName(autoResultMap = true)
相关推荐
soft20015256 小时前
MySQL 8.0.39 Rocky Linux 一键安装脚本(完整可直接运行)
linux·mysql·adb
无敌最俊朗@6 小时前
Qt 多线程编程: moveToThread 模式讲解
java·开发语言
im_AMBER6 小时前
weather-app开发手记 02 JSON基础 | API 调用 400 错误修复 | JWT 认证问题
笔记·学习·json·axios·jwt
木风小助理7 小时前
子查询与 JOIN 查询性能比较:执行机制与适用场景解析
数据库·sql·mysql
程序员清风7 小时前
别卷模型了!上下文工程才是大模型应用的王道!
java·后端·面试
九章-7 小时前
智慧文旅信创落地新标杆:四川省文旅厅完成MySQL 5.7平滑替换,筑牢省级管理平台自主可控底座
数据库·mysql
go__Ahead7 小时前
【Java】ThreadLocal源码解析
java
利剑 -~7 小时前
Spring AI Alibaba 1.1版本
java·人工智能·spring
雨中飘荡的记忆7 小时前
Guava工具库实战
java
while(1){yan}7 小时前
JAVA中如何操作文件
java·开发语言·面试