Issue Type: Bug Bug
Affects Versions: 4.1.5.SP1
Assignee: Unassigned
Components: core
Created: 06/Aug/12 9:55 AM
Description:

I'm working on an Database Synchronization tool and my problem is, when i have a char/varchar column type and it's field is empty on a select statement the method CharacterTypeDescriptor.wrap(X value, WrapperOptions options) throws a StringIndexOutOfBoundsException. By the way, looking at the implementation of method:
"...
if ( String.class.isInstance( value ) ) {
final String str = (String) value;
return Character.valueOf( str.charAt(0) );
..."

I can realize that the problem is on the "str.charAt(0)", my field(s) doesn't have any information, is empty and the system is a legacy system, I cannot modify that information. About the implementation of "wrap" it cannot be done this way:

"...
if ( String.class.isInstance( value ) ) {
final String str = (String) value;
if(str.length() == 0) { return null } else { return Character.valueOf( str.charAt(0) ); }
..."
??
Any solution that I can do?

Environment: Hibernate 4.1.5.SP1, MySQL server 5.1.63-community running on Windows.
Project: Hibernate ORM
Labels: core
Priority: Blocker Blocker
Reporter: Gustavo Vinícius
Original Estimate: 56h
Remaining Estimate: 56h
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