Allow configuration of code page when mapping String to DB character data
-------------------------------------------------------------------------
Key: HHH-2560
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2560
Project: Hibernate3
Issue Type: Improvement
Environment: All
Reporter: Greg Burcher
Priority: Minor
When instantiating mapped String properties from the database, Hibernate currently
constructs String objects without specifying what code page to use with the byte values
coming from the database. This assumes that the data in the database is encoded using the
same code page as the default OS code page in the environment where java is running. This
is not a valid assumption.
Hibernate should provide some way to configure the Session Factory with a default code
page and/or a code page for specific String mapped properties. Maybe there is already a
way to do this, but I have not found it.
The best work-around that I have currently found is to change the mapped property from
String to byte[]. This avoids the Hibernate code that incorrectly converts the bytes to a
String. However, I really want the interface of a String in my application, not a byte[],
so I wrap the byte[] in a class that converts to/from String on demand. I also then need
to create a UserType implementation and map to that UserType.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira