Hi,
First of all, thanks for this awesome tool ;)
I think we should do a null check in bindValuesInBulkInsert for every DB type, not only String.
Because as stated in the documentation for getAsLong for instance:
Returns
the Long value, or null if the value is missing or cannot be converted
In my case, I do not set a value in every column when inserting new rows using a bulkInsert and it yield a NPE.
I think there will be a special case for the _id column. If we haven't set a value for _id we shouldn't set a default one and instead let the system auto_increment this column.
Something like:
Long longValue = values.getAsLong(Columns.ID.getName());
if(longValue != null)
stmt.bindLong(i++, longValue);
else
i++;
Or, more compact
Long longValue = values.getAsLong(Columns.ID.getName());
if(longValue != null)
stmt.bindLong(i, longValue);
i++;
What do you think?
Hi,
First of all, thanks for this awesome tool ;)
I think we should do a null check in
bindValuesInBulkInsertfor every DB type, not only String.Because as stated in the documentation for
getAsLongfor instance:In my case, I do not set a value in every column when inserting new rows using a bulkInsert and it yield a NPE.
I think there will be a special case for the
_idcolumn. If we haven't set a value for_idwe shouldn't set a default one and instead let the systemauto_incrementthis column.Something like:
Or, more compact
What do you think?