Java.sql.SQLException: Invalid string value: '\ xAC \ xED \ x00 \ x05sr ...'

I have a code similar to:

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

after trying to add something to the column, I got

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

Where is the problem?

+4
source share
2 answers

I solved it, and so, maybe someone will find this useful:

I tried to use columnDefinition = "LONGTEXT" in the wrong place. There is only a link to the ProductLocalization , where multilingual 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 the ProductLocalization class, it started to work fine. Thank you all for your help.

+2
source

Of course, this is a MYSQL error ... More can be seen at http://bugs.mysql.com/bug.php?id=59456

+2
source

All Articles