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());
foo.setBar(em.find(Bar.class, 1L));
em.persist(foo);
Foo2 foo2 = new Foo2();
foo2.setBars(Arrays.asList(em.find(Bar.class, 1L), em.find(Bar.class, 2L)));
em.persist(foo2);
em.persist(new Foo2());