Building handler added

This commit is contained in:
2023-10-17 14:43:28 -04:00
parent 34024c9fb4
commit f889bcf927
3 changed files with 17 additions and 212 deletions
@@ -88,6 +88,23 @@ public class dbBuildingHandler extends dbHandlerBase {
return removeFromBuildings(b);
}
public ArrayList<Building> GET_ALL_BUILDINGS() {
ArrayList<Building> buildings = new ArrayList<>();
try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `obj_building`.*, `object`.`parent` FROM `object` INNER JOIN `obj_building` ON `obj_building`.`UID` = `object`.`UID` ORDER BY `object`.`UID` ASC;")) {
ResultSet rs = preparedStatement.executeQuery();
buildings = getObjectsFromRs(rs, 1000);
} catch (SQLException e) {
Logger.error(e);
}
return buildings;
}
public ArrayList<Building> GET_ALL_BUILDINGS_FOR_ZONE(Zone zone) {
ArrayList<Building> buildings = new ArrayList<>();