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)
相关推荐
Leo July5 小时前
【Java】Spring Security 6.x 全解析:从基础认证到企业级权限架构
java·spring·架构
星火开发设计5 小时前
C++ 数组:一维数组的定义、遍历与常见操作
java·开发语言·数据结构·c++·学习·数组·知识
码道功成5 小时前
Pycham及IntelliJ Idea常用插件
java·ide·intellij-idea
JZC_xiaozhong5 小时前
电商ERP如何同步订单数据到MySQL?集成方案解析
数据库·mysql·数据分析·etl工程师·嵌入式实时数据库·电商erp集成·数据集成与应用集成
消失的旧时光-19435 小时前
第四篇(实战): 订单表索引设计实战:从慢 SQL 到毫秒级
java·数据库·sql
それども6 小时前
@ModelAttribute vs @RequestBody
java
雨中飘荡的记忆6 小时前
深度详解Spring Context
java·spring
Tao____6 小时前
JAVA开源物联网平台
java·物联网·mqtt·开源·ruoyi
yqd6667 小时前
SpringSecurity的使用
java·spring
仙俊红7 小时前
Java Map 家族核心解析
java·开发语言