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)
相关推荐
plainGeekDev1 小时前
AlertDialog → DialogFragment
android·java·kotlin
流星白龙1 小时前
【MySQL高阶】13.其他存储引擎
android·数据库·mysql
薛定谔的悦1 小时前
光伏-储能-负荷联合预测:给 EMS 装上“预知能力“
java·数据库·人工智能·python·储能
大菜菜小个子1 小时前
template<typename T>使用
java·开发语言·算法
Refrain_zc1 小时前
Android开发: 拒绝 Activity 重建!onConfigurationChanged 实现平板横竖屏无缝切换
java
方也_arkling1 小时前
【Java-Day15】API篇-ArrayList集合
java·开发语言
Lyyaoo.1 小时前
【MySQL】SQL优化
android·sql·mysql
AI人工智能+电脑小能手1 小时前
【大白话说Java面试题 第89题】【Mysql篇】第19题:Hash 索引和 B+ 树索引的区别?它们在使用方面的区别?
java·数据库·mysql·面试·哈希算法
我是一颗柠檬1 小时前
【Java后端技术亮点】动态路由权限(按钮级权限),细粒度控制到按钮级别
java·开发语言·后端·状态模式
Fanfanaas1 小时前
C++ 继承
java·开发语言·jvm·c++·学习·算法