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)
相关推荐
陈文锦丫2 小时前
MQ的学习
java·开发语言
乌暮2 小时前
JavaEE初阶---线程安全问题
java·java-ee
爱笑的眼睛112 小时前
GraphQL:从数据查询到应用架构的范式演进
java·人工智能·python·ai
Seven973 小时前
剑指offer-52、正则表达式匹配
java
聪明努力的积极向上3 小时前
【MYSQL】字符串拼接和参数化sql语句区别
数据库·sql·mysql
代码or搬砖3 小时前
RBAC(权限认证)小例子
java·数据库·spring boot
青蛙大侠公主3 小时前
Thread及其相关类
java·开发语言
生产队队长3 小时前
Web:免费的JSON接口
json
Coder_Boy_3 小时前
DDD从0到企业级:迭代式学习 (共17章)之 四
java·人工智能·驱动开发·学习
2301_768350233 小时前
MySQL为什么选择InnoDB作为存储引擎
java·数据库·mysql