public void deleteRoom(String temp) {
        int rm = Integer.parseInt(temp);
        TypeEntity tempTE = null;

        Query g = em.createQuery("SELECT t from TypeEntity t");
        for (Object o : g.getResultList()) {
            TypeEntity p = (TypeEntity) o;
            if (p.getName().equals("null")) {
                tempTE = p;
                break;
            }

        }
        //System.out.println(tempTE.getId());

        ArrayList al = new ArrayList();

        Query q = em.createQuery("SELECT t from RoomEntity t");
        for (Object o : q.getResultList()) {
            RoomEntity p = (RoomEntity) o;
            System.out.println(p.getRoomNumber());
            if (p.getRoomNumber() == rm) {
                p.getType().getRooms().remove(p);
                p.setType(tempTE);
                em.merge(p.getType());
                em.merge(tempTE);
                em.merge(p);
                em.remove(p);
//                p.setType(tempTE);
//                tempTE.setRooms(al);
//                tempTE.getRooms().add(p);
//                em.merge(p);
//                em.merge(tempTE);
//                em.remove(p);
                System.out.println("removed room");
                break;
            }
        }
    }