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)
相关推荐
洛兮银儿4 分钟前
如何用python连接mysql数据库?
数据库·mysql
CDN3606 分钟前
MySQL安全加固十大硬核操作及CDN的隐形守护
数据库·mysql·安全
小江的记录本8 分钟前
【VO、DTO、Entity】VO、DTO、Entity三大核心数据对象全解析(附核心对比表 + 代码示例)
java·数据库·spring boot·spring·架构·mybatis·数据库架构
无籽西瓜a23 分钟前
TCP三次握手与四次挥手详解含图解
java·服务器·网络·tcp/ip
晨陌y24 分钟前
Maven完整配置教程:从零基础到实战,新手零踩坑
java·maven
SuniaWang27 分钟前
《Spring AI + 大模型全栈实战》学习手册系列·专题一:《RAG技术全景解析:从原理到架构设计》
java·javascript·人工智能·spring boot·后端·spring·架构
java1234_小锋28 分钟前
Java高频面试题:Spring是如何解决Bean的循环依赖?
java·开发语言·spring
历程里程碑30 分钟前
43. TCP -2实现英文查中文功能
java·linux·开发语言·c++·udp·c#·排序算法
爪哇斗罗31 分钟前
Explain详解与索引优化最佳实践
mysql
计算机学姐32 分钟前
基于SpringBoot的流浪动物救助收养系统
vue.js·spring boot·后端·mysql·java-ee·intellij-idea·mybatis