[英]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.