public static List<OfficeObject> listAll(){
        List<OfficeObject> result = new LinkedList<OfficeObject>();
        PreparedStatement ps = null;
        ResultSet rs = null;
        try {
            con = ConnectionManager.getConnection();
            if (con == null){
                return null;
            }
            String sql = "SELECT id, name, office_object_type_id FROM office_object";
            ps = con.prepareStatement(sql);
            rs = ps.executeQuery();
            while (rs.next()){
                result.add(OfficeObject.loadOfficeObject(rs.getInt(1), rs.getString(2), rs.getInt(3)));
            }
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
            logger.error("SQL query execution errors. Error: " + e.getSQLState() + " | " + e.getErrorCode());
        } finally {
            try {
                if (ps != null)
                    ps.close();
                if (rs != null)
                    rs.close();
            } catch (Exception e){
                logger.warn("Connection was closed with errors.");
            }
        }
        return result;
    }