简体   繁体   English

java.sql.SQLException:不正确的字符串值:'\xAC\xED\x00\x05sr...'

[英]java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05sr...'

I have code looking like that:我有这样的代码:

    @Column(name = COLUMN_DESCRIPTION, columnDefinition = "LONGTEXT")
private Map<Locale, String> description = new HashMap<>();

after trying to add something to column i got在尝试向列中添加一些内容后,我得到了

java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05sr...' for column 'description' at row 1

Where's the problem?问题在哪里?

肯定是一个MYSQL错误...更多信息可以在http://bugs.mysql.com/bug.php?id=59456上看到

I've solved it so here it is, maybe someone find it useful: 我已经解决了,所以在这里,也许有人发现它很有用:

I tried to use columnDefinition = "LONGTEXT" in wrong place. 我试图在错误的地方使用columnDefinition = "LONGTEXT" There's only reference to table ProductLocalization , where mulitilingual descriptions are stored. 仅提供表ProductLocalization ,其中存储了多语言描述。 When I used 我用的时候

@ManyToOne
@JoinColumn(name = AbstractLocalizingEntity.COLUMN_RELATED_ENTITY, nullable = false)
private Product entity;

@Column(name = Product.COLUMN_DESCRIPTION, columnDefinition = "LONGTEXT")
private String description;

in ProductLocalization class it started working fine. ProductLocalization类中,它开始正常工作。 Thanks all for your help. 感谢你的帮助。

It is not necessary a bug.不一定是错误。 You may try store this object as a blob.您可以尝试将此 object 存储为 blob。 Which is a data type in eg mysql例如 mysql 中的数据类型

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Hibernate 数据截断:不正确的 integer 值:'\xAC\xED\x00\x05sr\x00&amp; 尝试保存 OneToMany 关系时 - Hibernate data truncation: Incorrect integer value: '\xAC\xED\x00\x05sr\x00& when trying to save a OneToMany Relation 无法将字符串 '\xAC\xED\x00\x05~r...' 从二进制转换为 utf8mb3 - Cannot convert string '\xAC\xED\x00\x05~r...' from binary to utf8mb3 使用redis进行Spring引导缓存,key有\\xac\\xed\\x00\\x05t\\x00\\x06 - Spring boot caching with redis,key have \xac\xed\x00\x05t\x00\x06 java.sql.SQLException:字符串值不正确:&#39;\\ xF3 \\ xBE \\ x8D \\ x81&#39; - java.sql.SQLException: Incorrect string value: '\xF3\xBE\x8D\x81' 异常java.sql.SQLException:错误的字符串值:&#39;Rins&#39;列第1行的&#39;\\ xF0 \\ x9F \\ x92 \\ xBC&#39; - Exception java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\xBC' for column 'Rins' at row 1 at 这个&#39;\\ x00 \\ x00 \\ x00 \\ x05&#39;的编码是什么? - What encoding is this '\x00\x00\x00\x05'? Spring Boot and Mysql: Caused by: java.sql.SQLException: Incorrect string value: '\x96 like...' for column 'description' at row 1 - Spring Boot and Mysql : Caused by: java.sql.SQLException: Incorrect string value: '\x96 like...' for column 'description' at row 1 java.sql.SQLException: 不正确的字符串值:&#39;\\xF0\\x9F\\x91\\xBD\\xF0\\x9F...&#39; - java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\xBD\xF0\x9F...' java.sql.SQLException:字符串值不正确:&#39;\\ xF0 \\ x9F \\ x98 \\ x8F&#39;表示第1行的&#39;tweetcontent&#39;列 - java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8F' for column 'tweetcontent' at row 1 将 mysql 5.5.62 数据库架构迁移到 mysql 8.0.27 - 偶发错误 java.sql.SQLException:字符串值不正确:列的“\\xE2\\x80\\x8B” - migrating mysql 5.5.62 database schema to mysql 8.0.27 - sporadic error java.sql.SQLException: Incorrect string value: '\xE2\x80\x8B' for column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM