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)
相关推荐
梁萌1 分钟前
保姆级的MySQL执行计划(Explain)解读
数据库·mysql·explain·执行计划
JIngJaneIL3 分钟前
基于Java+ vue智慧医药系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
2501_916766547 分钟前
【Spring框架】SpringJDBC
java·后端·spring
谷哥的小弟13 分钟前
Spring Framework源码解析——ApplicationContextInitializer
java·spring·源码
布谷歌16 分钟前
在java中实现c#的int.TryParse方法
java·开发语言·python·c#
cq林志炫22 分钟前
MySQL 英文逗号隔开的数据如何模糊精确查询
mysql
while(1){yan}27 分钟前
网络基础知识
java·网络·青少年编程·面试·电脑常识
Ulana31 分钟前
计算机基础10大高频考题解析
java·人工智能·算法
黄俊懿38 分钟前
【深入理解SpringCloud微服务】Seata(AT模式)源码解析——@GlobalTransactional注解与@globalLock生效的原理
java·spring cloud·微服务·云原生·架构·系统架构·架构师
wheelmouse778842 分钟前
一个优雅、通用、零侵入的 CSV 导出工具类(Java 实战)
java·开发语言