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)
相关推荐
x***38162 分钟前
springboot和springframework版本依赖关系
java·spring boot·后端
“αβ”16 分钟前
MySQL表的操作
linux·网络·数据库·c++·网络协议·mysql·https
S***848818 分钟前
SpringSecurity踢出指定用户
java
p***s9119 分钟前
Spring数据库原理 之 DataSource
java·数据库·spring
adobehu19 分钟前
麒麟系统安装jdk17
java·jdk
spencer_tseng21 分钟前
java.util.IllegalFormatPrecisionException
java·printf
虹科网络安全23 分钟前
艾体宝干货 | Redis Java 开发系列#1 从零开始的环境搭建与实践指南
java·数据库·redis
铅笔侠_小龙虾43 分钟前
Arthas 命令
java·jvm
神秘的土鸡1 小时前
openEuler 25.09 企业级 MySQL主从复制部署与性能优化实战提升50%
linux·数据库·mysql·性能优化·openeuler
seeyoutlb1 小时前
微服务全局日志处理
java·python·微服务