HHH-4699 trim value from database before Enum.valueOf()
this change fixes the problem with fixed size columns with enum values that are right padded.
This commit is contained in:
parent
0b488b92a0
commit
ad5dd18aac
|
@ -455,7 +455,10 @@ public class EnumType implements EnhancedUserType, DynamicParameterizedType,Logg
|
||||||
|
|
||||||
private Enum fromName(String name) {
|
private Enum fromName(String name) {
|
||||||
try {
|
try {
|
||||||
return Enum.valueOf( enumClass, name );
|
if(name == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Enum.valueOf( enumClass, name.trim() );
|
||||||
}
|
}
|
||||||
catch ( IllegalArgumentException iae ) {
|
catch ( IllegalArgumentException iae ) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
|
|
Loading…
Reference in New Issue