diff --git a/src/main/java/ca/tweetzy/auctionhouse/database/DataManager.java b/src/main/java/ca/tweetzy/auctionhouse/database/DataManager.java index e33686c..220e686 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/database/DataManager.java +++ b/src/main/java/ca/tweetzy/auctionhouse/database/DataManager.java @@ -324,7 +324,7 @@ public class DataManager extends DataManagerAbstract { public void insertAuction(AuctionedItem item, Callback callback) { this.databaseConnector.connect(connection -> { - try (PreparedStatement statement = connection.prepareStatement("INSERT INTO " + this.getTablePrefix() + "auctions(id, owner, highest_bidder, owner_name, highest_bidder_name, category, base_price, bid_start_price, bid_increment_price, current_price, expired, expires_at, item_material, item_name, item_lore, item_enchants, item, listed_world, infinite, allow_partial_buys, server_auction, is_request) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { + try (PreparedStatement statement = connection.prepareStatement("INSERT INTO " + this.getTablePrefix() + "auctions(id, owner, highest_bidder, owner_name, highest_bidder_name, category, base_price, bid_start_price, bid_increment_price, current_price, expired, expires_at, item_material, item_name, item_lore, item_enchants, item, listed_world, infinite, allow_partial_buys, server_auction, is_request, request_count) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) { final AuctionAPI api = AuctionAPI.getInstance(); PreparedStatement fetch = connection.prepareStatement("SELECT * FROM " + this.getTablePrefix() + "auctions WHERE id = ?"); @@ -351,6 +351,7 @@ public class DataManager extends DataManagerAbstract { statement.setBoolean(20, item.isAllowPartialBuy()); statement.setBoolean(21, item.isServerItem()); statement.setBoolean(22, item.isRequest()); + statement.setInt(23, item.getRequestAmount()); statement.executeUpdate(); @@ -742,6 +743,7 @@ public class DataManager extends DataManagerAbstract { auctionItem.setAllowPartialBuy(hasColumn(resultSet, "allow_partial_buys") && resultSet.getBoolean("allow_partial_buys")); auctionItem.setServerItem(resultSet.getBoolean("server_auction")); auctionItem.setRequest(resultSet.getBoolean("is_request")); + auctionItem.setRequestAmount(resultSet.getInt("request_count")); return auctionItem; }