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)
相关推荐
@小匠5 分钟前
Spring Boot Nacos绑定 Map 时中文 key 导致启动失败:一次从复现到源码的排查实录
java·开发语言·前端
Knight_AL5 分钟前
Lombok @Builder 踩坑:build() 前后对象类型不一样
android·java·开发语言
doubt。18 分钟前
大模型prompt工程Zero-Shot与Few-Shot以及json格式
人工智能·深度学习·机器学习·语言模型·json·prompt
SamChan9028 分钟前
PDF翻译中的并发控制:用Semaphore防止API限流与资源耗尽
java·jvm·pdf
大黄说说39 分钟前
Java 与 Kotlin 混合开发避坑指南:老项目平滑迁移 Kotlin 实操手册
java·开发语言·kotlin
Architect_Lee1 小时前
mac快速安装mysql
数据库·mysql·macos
snow@li1 小时前
SpringBoot:AOP日志切面全景梳理/原理+流程+实战+避坑
java·开发语言·spring boot
ma_king1 小时前
Spring Boot 接入飞书自定义机器人
java·后端
2401_894915531 小时前
部署 GEO 优化源码常见报错排查:端口、伪静态、缓存问题解决
java·运维·服务器·后端·缓存·开源
七牛开发者2 小时前
Codex 实践系列 Vol.04:用 Goal 和 Plan 管住一个长任务
java·数据库·人工智能·github·copilot