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)
相关推荐
yyuuuzz5 分钟前
nginx 502 排查,先看上游超时那一行
android·java·运维·nginx·502
Java后端的Ai之路7 分钟前
Java并发编程25-集合的线程安全
java·安全·面试
CoderYanger31 分钟前
Java EE 进阶:9.MyBatis 操作数据库(进阶)(第一弹)
java·数据库·spring·面试·java-ee·tomcat·mybatis
码云社区44 分钟前
Java租房平台源码方案:Vue 3房源审核、UniApp预约看房与房东管理
java·vue.js
codigger2 小时前
ThreadLocal 会内存泄露吗?
java·内存泄漏·threadlocal
挖掘狂人2 小时前
ThreadLocal 会内存泄露吗?
java·安全·架构
用户298698530143 小时前
在 Python 中把 Word 文档转换为 JSON 的三种实现方式
python·json·api
未秃头的程序猿3 小时前
给新模块加了个 @MapperScan,启动崩了,最后发现跟 MapperScan 没关系
java·后端·mybatis
SimonKing3 小时前
WorkBuddy又推出新的限免模型(Hy4 flash)了,羊毛可以薅起来了
java·后端·程序员
csdn_aspnet3 小时前
Docker 啟動MySQL Server連上MySQL Workbench
mysql·docker·容器