akuzma
akuzma

Reputation: 1554

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?

Upvotes: 4

Views: 18506

Answers (3)

wwww
wwww

Reputation: 822

It is not necessary a bug. You may try store this object as a blob. Which is a data type in e.g. mysql

Upvotes: 0

akuzma
akuzma

Reputation: 1554

I've solved it so here it is, maybe someone find it useful:

I tried to use columnDefinition = "LONGTEXT" in wrong place. There's only reference to table ProductLocalization, where mulitilingual descriptions are stored. 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. Thanks all for your help.

Upvotes: 2

Anurag Shukla
Anurag Shukla

Reputation: 195

Surely it is a MYSQL Bug ... More can be seen at http://bugs.mysql.com/bug.php?id=59456

Upvotes: 2

Related Questions