4

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?

Apurv
  • 3,723
  • 3
  • 30
  • 51
akuzma
  • 1,592
  • 6
  • 22
  • 49
  • 1
    Check this link http://stackoverflow.com/questions/13653712/java-sql-sqlexception-incorrect-string-value-xf0-x9f-x91-xbd-xf0-x9f – Meherzad Feb 25 '13 at 09:26
  • You need to show what you are adding to the column. – nneonneo Feb 25 '13 at 09:26
  • Add the table structure that you have created, show COLUMN_DESCRIPTION information the error is there you have to specify proeper keywords there – Meherzad Feb 25 '13 at 09:33

3 Answers3

2

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

Anurag Shukla
  • 195
  • 2
  • 6
2

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.

akuzma
  • 1,592
  • 6
  • 22
  • 49
0

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

wwww
  • 760
  • 1
  • 11
  • 20