Refactor warehouse part two.
This commit is contained in:
@@ -82,6 +82,24 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
||||
return transactionsList;
|
||||
}
|
||||
|
||||
public boolean UPDATE_WAREHOUSE(Warehouse warehouse) {
|
||||
|
||||
JSONObject warehouseJSON = new JSONObject(warehouse.resources);
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `dyn_warehouse` SET `warehouse` = ? WHERE `cityUID` = ?")) {
|
||||
|
||||
preparedStatement.setString(2, warehouseJSON.toString());
|
||||
preparedStatement.setInt(1, warehouse.city.getObjectUUID());
|
||||
|
||||
return (preparedStatement.executeUpdate() > 0);
|
||||
|
||||
} catch (SQLException e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void LOAD_WAREHOUSES() {
|
||||
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
|
||||
Reference in New Issue
Block a user