Shift ItemEntry columns for listID

listID is in column 1
This commit is contained in:
NMerz 2020-10-08 17:08:10 -04:00
parent fad60c6b90
commit 3feb8a4317

View File

@ -1,6 +1,5 @@
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.time.LocalDateTime;
public class ItemEntry { public class ItemEntry {
Integer listID; Integer listID;
@ -10,10 +9,29 @@ public class ItemEntry {
Boolean purchased; Boolean purchased;
public ItemEntry(Integer listID, ResultSet listRow) throws SQLException { public ItemEntry(Integer listID, ResultSet listRow) throws SQLException {
this.listID = listID; this.listID = listID;
productID = listRow.getInt(1); productID = listRow.getInt(2);
quantity = listRow.getInt(2); quantity = listRow.getInt(3);
addedDate = listRow.getTimestamp(3).toInstant().toEpochMilli(); addedDate = listRow.getTimestamp(4).toInstant().toEpochMilli();
purchased = listRow.getBoolean(4); purchased = listRow.getBoolean(5);
}
@Override
public String toString() {
return "ItemEntry{" +
"listID=" + listID +
", productID=" + productID +
", quantity=" + quantity +
", addedDate=" + addedDate +
", purchased=" + purchased +
'}';
}
public Integer getListID() {
return listID;
}
public void setListID(Integer listID) {
this.listID = listID;
} }
public Integer getProductID() { public Integer getProductID() {