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)
相关推荐
Zhu75813 小时前
在k8s集群部署MySQL单实例,支持多个主流发行版
android·mysql·kubernetes
io无心17 小时前
Shardingsphere5分库分表
数据库·mysql
mifengxing17 小时前
LeetCode 41.缺失的第一个正数|Hard题O(n)+O(1)最优解法深度解析
java·算法·leetcode·排序算法
wWYy.17 小时前
Mysql:主键索引 唯一索引 普通索引 前缀索引
数据库·mysql
markinmarkin19 小时前
Spring 中Bean 的作用域有哪些?
java·后端·spring
山荷枝20 小时前
Java学习第十天
java·学习
matlabgoodboy21 小时前
计算机毕设代做|Java Python Matlab APP 全套开发设计
java·python·课程设计
猿长大人21 小时前
C# | JSON 序列化中的多态接口处理:基于 Attribute 实现精准 $type 控制
c#·json
程序员雷欧1 天前
环形缓冲区深度解析:从基础原理到Disruptor源码的全面剖析
java
xiaoqiMikko1 天前
Dependabot 面板全绿,不代表你的 Tomcat 没洞
java·spring boot