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)
相关推荐
小羊没烦恼!14 小时前
微服务化的基石——持续集成
java·大数据·word·powerpoint·.net
俊昭喜喜里15 小时前
java中的继承和多态的区别
java
小羊没烦恼!15 小时前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
譕痕15 小时前
JSONObject与JSONArray封装数据格式区别
java·json
A黄俊辉A15 小时前
uniapp webview中实现 app和内嵌的H5双向通信
vue.js·json
胡写代码15 小时前
别再前后端各写一套表单校验了
java·后端
小鱼能吃糖15 小时前
缺陷修复总览 · mall电商项目:5类缺陷,1个病根,4个业务域
java·电商
此时不提桶,更待何时16 小时前
01-06-A-JVM排查实战详解
java·jvm
小白男神16 小时前
MySQL进阶学习四(存储过程、游标、触发器)
mysql
这个DBA有点耶16 小时前
MVCC深入:Read View、版本链与快照读——InnoDB并发控制的内核
数据库·mysql·架构