public void testSelect() throws Exception {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("testPU");
EntityManager em = emf.createEntityManager();
em.getTransaction().begin();
em.persist(new Bar());
em.persist(new Bar());
em.getTransaction().commit();
em.getTransaction().begin();
em.persist(new Foo("foo", Calendar.getInstance()));
Foo foo = new Foo("bar", Calendar.getInstance());