diff --git a/hibernate-core/src/main/java/org/hibernate/type/EnumType.java b/hibernate-core/src/main/java/org/hibernate/type/EnumType.java index b73a608aa3..2892b9dc6b 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/EnumType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/EnumType.java @@ -455,7 +455,10 @@ public class EnumType implements EnhancedUserType, DynamicParameterizedType,Logg private Enum fromName(String name) { try { - return Enum.valueOf( enumClass, name ); + if(name == null) { + return null; + } + return Enum.valueOf( enumClass, name.trim() ); } catch ( IllegalArgumentException iae ) { throw new IllegalArgumentException(