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)
相关推荐
tumeng07111 天前
Spring详解
java·后端·spring
.柒宇.1 天前
MySQL的PXC高可用实战
数据库·mysql
深邃-1 天前
【Web安全】-基础环境安装:虚拟机安装,JDK环境安装(1)
java·开发语言·计算机网络·安全·web安全·网络安全·安全架构
小雅痞1 天前
[Java][Leetcode hard] 135. 分发糖果
java·算法·leetcode
Chasing__Dreams1 天前
Mysql--基础知识点--101--在线扩容
数据库·mysql
jwt7939279371 天前
Spring之DataSource配置
java·后端·spring
逻辑驱动的ken1 天前
Java高频面试场景题07
java·开发语言·面试·职场和发展·求职招聘·春招
slarymusic1 天前
解决报错net.sf.jsqlparser.statement.select.SelectBody
java
callJJ1 天前
JVM 内存区域划分详解——从生活比喻到运行时数据区全景图
java·jvm·面试·内存区域划分
小江的记录本1 天前
【网络安全】《网络安全与数据安全核心知识体系》(包括数据脱敏、数据加密、隐私合规、等保2.0)
java·网络·后端·python·算法·安全·web安全