public ArrayList searchRoomNumber(Date checkin, Date checkout) {
        ArrayList temp = new ArrayList();

        //find all room first
        Query q = em.createQuery("SELECT t from RoomEntity t");
        for (Object o : q.getResultList()) {
            RoomEntity p = (RoomEntity) o;
            temp.add(p.getRoomNumber());
        }

        //search booking and deduct the rooms from temp
        Query bk = em.createQuery("SELECT b from BookingEntity b");
        for (Object o : bk.getResultList()) {
            BookingEntity be = (BookingEntity) o;
            if ((checkin.compareTo(be.getCheckinDate()) >= 0 && checkin.compareTo(be.getCheckoutDate()) <= 0)
                    || (checkout.compareTo(be.getCheckinDate()) >= 0 && checkout.compareTo(be.getCheckoutDate()) <= 0)) {
                System.out.println("within range, must remove");
                Collection<RoomEntity> temp2 = be.getRooms();

                Iterator itr = temp2.iterator();

                while (itr.hasNext()) {
                    RoomEntity element = (RoomEntity) itr.next();
                    temp.remove(temp.indexOf(element.getRoomNumber()));
                    //System.out.println("display temp: " + temp + " " + element.getRoomNumber());
                }

            }

        }

        return temp;
    }