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)
相关推荐
灯澜忆梦12 分钟前
【MySQL18】进阶篇 | MySQL管理
数据库·mysql
桦说编程43 分钟前
盘点并发集合里那些容易误判的行为
java·后端·性能优化
用户77833661321144 分钟前
SERP 返回 JSON 用 Pydantic 强校验:类型安全解析
json
IT爱学堂1 小时前
java版数据结构和算法+AI算法和技能学习指南
java·开发语言
lv__pf2 小时前
spring之整合mybatis【TL spring 12】
mysql·spring·mybatis
evans在进步2 小时前
LeetCode 394:字符串解码——Java 单栈模拟与嵌套解析详解
java·python·leetcode
m0_547486663 小时前
《Java程序设计与实践 》全套PPT课件2026
java·开发语言
土司大王3 小时前
LeetCode hto100——字母异位词分组
java·算法·leetcode
码匠许师傅4 小时前
【C++ 面试真题】聊聊 C++ 中的 lambda 表达式
java·c++·面试
jason.zeng@15022074 小时前
linux的top命令
java·linux·服务器