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 小时前
实测对比:哪款开源 Kubernetes MySQL Operator 最值得用?(2026 深度评测)
数据库·mysql·云原生
一灯架构6 小时前
90%的人答错!一文带你彻底搞懂ArrayList
java·后端
Y4090017 小时前
【多线程】线程安全(1)
java·开发语言·jvm
布局呆星7 小时前
SpringBoot 基础入门
java·spring boot·spring
风吹迎面入袖凉8 小时前
【Redis】Redisson的可重入锁原理
java·redis
w6100104668 小时前
cka-2026-ConfigMap
java·linux·cka·configmap
SPC的存折8 小时前
MySQL 8组复制完全指南
linux·运维·服务器·数据库·mysql
语戚8 小时前
力扣 968. 监控二叉树 —— 贪心 & 树形 DP 双解法递归 + 非递归全解(Java 实现)
java·算法·leetcode·贪心算法·动态规划·力扣·
quxuexi9 小时前
网络通信安全与可靠传输:从加密到认证,从状态码到可靠传输
java·安全·web