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)
相关推荐
long3167 小时前
MySQL 学习练习(配套 01 入门资料)
数据库·学习·mysql
Pluchon7 小时前
Java个人综合项目——萌部落社区V2.0
java·python·spring·spring cloud·postman·idea
梦雨生生8 小时前
java开发工具(学习第一天)
java·开发语言·学习
她说可以呀8 小时前
Spring-ai-alibaba文生图
java·人工智能·spring
大眼、不聚光9 小时前
5.mysql--主从同步安装部署
数据库·mysql
松仔log10 小时前
Java中级——组合和继承
android·java·开发语言
不才不才不不才10 小时前
Spring 源码系列(16): doDispatch 全流程——一次请求的主干链路
java·后端·spring
snow@li11 小时前
HikariCP:高性能数据库连接池全景深入梳理
java·数据库
sugar__salt11 小时前
Spring 三层架构与 IoC、依赖注入完全指南
java·spring boot·后端·spring·架构·maven·intellij-idea
edwarddamon11 小时前
Spring Cloud 配置热更新与 Bean 代理机制梳理
java·后端