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)
相关推荐
Rain的Java大神之路3 小时前
LeetCode 40 组合总和 II:面试官想听的不是回溯,而是那行去重代码
java·leetcode·面试
FungLeo3 小时前
FengCMS ·PHP+MySQL 升级实录 · 安全加固的克制:一份“不做什么“清单,比修了几个漏洞更重要
mysql·安全·php·安全加固·fengcms
wno7044 小时前
Centos下PostgreSQL安装部署详细步骤
java·数据库·spring boot
nice_lcj5205 小时前
【从零理解计算机网络 · 04】TCP 三次握手:为什么恰好是三次
java·后端·tcp/ip·计算机网络·面试·tcp·三次握手
Sarvartha5 小时前
反射综合案例:SQL 语句生成
java·开发语言
小Ti客栈14 小时前
MySQL 常用函数速查(完整篇)
数据库·mysql·adb
Resean022315 小时前
Spring 源码分析(二)配置类的解析与扫描
java·后端·spring
小毛球.15 小时前
第 3 篇:IDEA 最新版下载与完整安装教程(Mac)
java·macos·intellij-idea·idea
Misnearch17 小时前
ScheduledExecutorService
java·线程池
nice_lcj52017 小时前
MySQL 主从复制与读写分离:从库怎么跟着主库走
数据库·mysql·面试·binlog·读写分离·主从复制