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)
相关推荐
咖啡八杯8 小时前
GoF设计模式——策略模式
java·后端·spring·设计模式
用户1285261160216 小时前
我把祖传Java项目重构后,接口响应从3s砍到了200ms,只改了这几行代码
java
Linsk16 小时前
组件 = 模板 + 业务逻辑
java·前端·vue.js
星沉远浦17 小时前
用Gemini高效解决Java代码报错难以定位的问题
java
用户2986985301421 小时前
Word 文档字符级格式化:Java 实现方案详解
java·后端
笨鸟飞不快21 小时前
从单个服务到集群:一次完整的性能排查复盘
java·前端
荣码21 小时前
用Streamlit给AI应用套个界面,10行代码出Web页面
java·python
SamDeepThinking21 小时前
Java微服务练习方式
java·后端·微服务
朦胧之1 天前
AI 编程-老项目改造篇
java·前端·后端