(ldb) Better handling of null pubYear

This commit is contained in:
Viktor Lofgren 2023-08-30 23:08:27 +02:00
parent 764e7d1315
commit 763ed260c3

View File

@ -57,12 +57,11 @@ public class LinkdbWriter {
stmt.setLong(8, document.dataHash()); stmt.setLong(8, document.dataHash());
stmt.setDouble(9, document.urlQuality()); stmt.setDouble(9, document.urlQuality());
if (document.pubYear() == null) { if (document.pubYear() == null) {
stmt.setNull(10, Types.INTEGER); stmt.setInt(10, 0);
} else { } else {
stmt.setInt(10, document.pubYear()); stmt.setInt(10, document.pubYear());
} }
stmt.addBatch();
if (++i > 1000) { if (++i > 1000) {
stmt.executeBatch(); stmt.executeBatch();