j-easy / easy-batch

The simple, stupid batch framework for Java
https://github.com/j-easy/easy-batch/wiki
MIT License
611 stars 199 forks source link

BeanPropertiesPreparedStatementProvider is failing to prepare statement if bean properties has null value #372

Closed ashtttt closed 4 years ago

ashtttt commented 4 years ago

In the prepareStatement method,

   Object value = propertyDescriptor.getReadMethod().invoke(record);
   Integer sqlType = javaTypesToSqlTypes.get(value.getClass());

for some reason if value evaluates to null, this class is failing to prepare statement.

fmbenhassine commented 4 years ago

Thank you for raising this issue. Indeed, that's a bug. Let me plan the fix for the next release. Contributions are welcome!

fmbenhassine commented 4 years ago

Fixed in #376 .