Switch to millis for times

There are issues with the serialization of the time objects since the constructors are not public. Passing times around in milliseconds avoid them.
This commit is contained in:
NMerz
2020-10-06 21:39:23 -04:00
parent 68051fdaca
commit 56c9a3f99d
6 changed files with 25 additions and 26 deletions

View File

@@ -6,13 +6,13 @@ public class ItemEntry {
Integer listID;
Integer productID;
Integer quantity;
LocalDateTime addedDate;
long addedDate;
Boolean purchased;
public ItemEntry(Integer listID, ResultSet listRow) throws SQLException {
this.listID = listID;
productID = listRow.getInt(1);
quantity = listRow.getInt(2);
addedDate = listRow.getObject(3, LocalDateTime.class);
addedDate = listRow.getTimestamp(3).toInstant().toEpochMilli();
purchased = listRow.getBoolean(4);
}
@@ -32,11 +32,11 @@ public class ItemEntry {
this.quantity = quantity;
}
public LocalDateTime getAddedDate() {
public long getAddedDate() {
return addedDate;
}
public void setAddedDate(LocalDateTime addedDate) {
public void setAddedDate(long addedDate) {
this.addedDate = addedDate;
}