mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 05:04:52 +00:00
HHH-6408 Be tolerant with empty (ie not null) properties
This commit is contained in:
parent
671a273e75
commit
f0a8fe5643
@ -160,7 +160,12 @@ public static Integer getInteger(String name, Map values) {
|
||||
return (Integer) value;
|
||||
}
|
||||
if ( String.class.isInstance( value ) ) {
|
||||
return Integer.valueOf( (String) value );
|
||||
//empty values are ignored
|
||||
final String trimmed = value.toString().trim();
|
||||
if ( trimmed.isEmpty() ) {
|
||||
return null;
|
||||
}
|
||||
return Integer.valueOf( trimmed );
|
||||
}
|
||||
throw new ConfigurationException(
|
||||
"Could not determine how to handle configuration value [name=" + name +
|
||||
|
Loading…
x
Reference in New Issue
Block a user