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)
相关推荐
fire-flyer10 分钟前
设计模式之观察者模式
java·开发语言
⑩-41 分钟前
苍穹外卖Day(1)
java·数据库·spring boot·spring·java-ee·mybatis
程序员buddha1 小时前
C语言操作符详解
java·c语言·算法
l0sgAi1 小时前
SpringAI 整合MCP实现联网搜索 (基于tavily)
java·后端
AAA阿giao1 小时前
JavaScript 深拷贝全解析:从栈与堆内存机制到安全对象复制实践
前端·javascript·json
❀͜͡傀儡师1 小时前
使用DelayQueue 分布式延时队列,干掉定时任务!
java·分布式·delayqueue·spingboot
失散131 小时前
分布式专题——55 ElasticSearch性能调优最佳实践
java·分布式·elasticsearch·架构
Java水解1 小时前
MySQL 慢查询 debug:索引没生效的三重陷阱
后端·mysql
jonyleek2 小时前
【JVS更新日志】低代码、APS排产、物联网、企业计划11.12更新说明!
java·物联网·低代码·前端框架·团队开发