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)
相关推荐
小马爱打代码4 分钟前
避坑指南:MySQL 迁移到 TiDB
数据库·mysql·tidb
无敌最俊朗@5 分钟前
Qt事件循环队列剖析!!!
java
v***56518 分钟前
Spring Cloud Gateway 整合Spring Security
java·后端·spring
python零基础入门小白36 分钟前
【万字长文】大模型应用开发:意图路由与查询重写设计模式(从入门到精通)
java·开发语言·设计模式·语言模型·架构·大模型应用开发·大模型学习
高山上有一只小老虎1 小时前
构造A+B
java·算法
学困昇1 小时前
C++中的异常
android·java·c++
q***57741 小时前
MySQL 实验1:Windows 环境下 MySQL5.5 安装与配置
windows·mysql·adb
MC丶科1 小时前
Java设计模式漫画英雄宇宙-工厂模式 —Factory博士的“超级英雄制造机”!
java·设计模式·漫画
虎子_layor1 小时前
告别Redis瓶颈:Caffeine本地缓存优化实战指南
java·后端
q***98521 小时前
什么是Spring Boot 应用开发?
java·spring boot·后端