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)
相关推荐
白鸽(二般)3 小时前
MinIO Java Client API
java·开发语言
软萌萌的14 小时前
Java Spring Boot 修改yml配置&加载顺序规则
java·spring boot·python
IT小盘5 小时前
13-企业Prompt模板-角色任务约束与输出格式
java·前端·prompt
爱敲键盘的猴子5 小时前
Java并发编程 -- volatile
java·java并发
plainGeekDev7 小时前
工厂模式 → Hilt
android·java·kotlin
plainGeekDev7 小时前
Application 单例 → Hilt Singleton
android·java·kotlin
888CC++7 小时前
C语言与C++的区别:从面向过程到面向对象
java·c语言·c++
学者猫头鹰8 小时前
分布式事务实战教程
java·分布式
heimeiyingwang9 小时前
【架构实战】Kubernetes调度器深度剖析:从Pod调度到自定义调度器
java·架构·kubernetes
纳兰青华10 小时前
回文侦探:三种境界破解最长回文子串
java·算法·动态规划