(Collection<Hotel>)em.createNativeQuery(query, Hotel.class ).getResultList();
Assert.assertEquals(0, hotelCol.size());
// add hotels
em.getTransaction().begin();
Hotel h3 = new Hotel("Test Hotel 3");
em.persist(h3);
em.getTransaction().commit();
em.getTransaction().begin();
Hotel h4 = new Hotel("Test Hotel 4");
em.persist(h4);
em.getTransaction().commit();
// check number of hotels
hotelCol = (Collection<Hotel>)em.createNativeQuery(query, Hotel.class ).getResultList();
Assert.assertEquals(2, hotelCol.size());
// remove hotels
em.getTransaction().begin();
Hotel h = (Hotel) em.find(Hotel.class, h3.getHotelId());
em.remove(h);
em.getTransaction().commit();
em.getTransaction().begin();
h = (Hotel) em.find(Hotel.class, h4.getHotelId());
em.remove(h);