美文网首页
疫苗-mysql JSON类型,myBatis不支持

疫苗-mysql JSON类型,myBatis不支持

作者: ontheway_sh | 来源:发表于2020-07-17 16:06 被阅读0次

### Cause: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.

; ]; Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.] with root cause

com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Cannot create a JSON value from a string with CHARACTER SET 'binary'.

myBatis 自动生成的json类型为OTHER,对象类型为 Object,

发现myBatis现在并不支持JOSN,保存报错

解决办法

将对象换成 String 类型,mapper 文件里换成对应的VARCHAR类型,toJSONString保存

 保存成功

相关文章

网友评论

      本文标题:疫苗-mysql JSON类型,myBatis不支持

      本文链接:https://www.haomeiwen.com/subject/hawghktx.html