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)
相关推荐
Wang15304 小时前
jdk内存配置优化
java·计算机网络
尽兴-5 小时前
《深入剖析:全面理解 MySQL 的架构设计》
数据库·mysql·数据库架构设计·理解mysql架构
0和1的舞者5 小时前
Spring AOP详解(一)
java·开发语言·前端·spring·aop·面向切面
Wang15305 小时前
Java多线程死锁排查
java·计算机网络
梦幻通灵5 小时前
Mysql字段判空实用技巧
android·数据库·mysql
小小星球之旅5 小时前
CompletableFuture学习
java·开发语言·学习
jiayong236 小时前
知识库概念与核心价值01
java·人工智能·spring·知识库
皮皮林5516 小时前
告别 OOM:EasyExcel 百万数据导出最佳实践(附开箱即用增强工具类)
java
Da Da 泓7 小时前
多线程(七)【线程池】
java·开发语言·线程池·多线程
To Be Clean Coder7 小时前
【Spring源码】getBean源码实战(三)
java·mysql·spring