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)
相关推荐
Ivanqhz17 分钟前
Rust &‘static str浅析
java·前端·javascript·rust
Oo大司命oO2 小时前
藏在正则表达式里的陷阱
数据库·mysql·正则表达式
weixin_419658313 小时前
Docker 搭建 Jenkins 服务
java·docker·jenkins
captain3764 小时前
多线程线程安全问题
java·java-ee
CoderYanger4 小时前
A.每日一题:1979. 找出数组的最大公约数
java·程序人生·算法·leetcode·面试·职场和发展·学习方法
灵极海4 小时前
LangChain4j RAG 实战完整指南:从入门到踩坑
java·langchain
yaoxin5211234 小时前
476. Java 反射 - 调用方法
java·开发语言
Ivanqhz5 小时前
Rust Lazy浅析
java·javascript·rust
bksczm5 小时前
Linux之日志和线程池、内存池
java·开发语言
三十岁老牛再出发5 小时前
07.26每日总结
linux·c语言·mysql