Alessandro Polverini created OPENJPA-2382:
---------------------------------------------
Summary: Wrong handling of char property
Key: OPENJPA-2382
URL: https://issues.apache.org/jira/browse/OPENJPA-2382
Project: OpenJPA
Issue Type: Bug
Components: jpa
Affects Versions: 2.2.2
Environment: Spring 3.2.1
spring-data-jpa 1.3.0
mysql 5.5.31
Reporter: Alessandro Polverini
I have an entity with a property defined in this way:
@Column(name = "type", columnDefinition = "char")
private char type = 'C';
The column definition in the mysql table is char(1) and when I try to persist
the entity I got an error saying that the column is not wide enough and the
data would be truncated.
I then changed to column from char to varchar(10) and I discovered that openjpa
is saving the ascii code of the char in the column instead of the char itself.
So for example I had a '67' value instead of 'C'.
The same program runs perfectly fine with Hibernate.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira