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)
相关推荐
铭keny2 分钟前
MySQL 误删数据恢复操作手册
数据库·mysql
没有bug.的程序员5 分钟前
JVM 与 Docker:资源限制的真相
java·jvm·后端·spring·docker·容器
lkbhua莱克瓦247 分钟前
IO流——打印流
java·开发语言·前端·学习方法
赵得C15 分钟前
软件设计师前沿考点精讲:新兴技术与性能优化实战
java·开发语言·分布式·算法·设计模式·性能优化
组合缺一16 分钟前
Solon AI 开发学习17 - generate - 使用复杂提示语
java·学习·ai·llm·solon·mcp
CodeAmaz19 分钟前
MySQL 调优的(实战思路)
数据库·mysql·优化
小吴学不废Java20 分钟前
Mysql的索引详解
mysql
爱笑的眼睛1120 分钟前
从零构建与深度优化:PyTorch训练循环的工程化实践
java·人工智能·python·ai
TextIn智能文档云平台26 分钟前
抽取出的JSON结构混乱,如何设计后处理规则来标准化输出?
人工智能·json
狂奔小菜鸡33 分钟前
Day27 | Java集合框架之List接口详解
java·后端·java ee