Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- em.getTransaction().begin();
- Owner owner = new Owner("bla", 42);
- int id = owner.getId();
- Foo foo = new Foo(true); // you probably just could pass owner here
- owner.setFoo(foo);
- em.persist(owner);
- em.flush();
- // owner = em.find(Owner.class, id); // try with and without this line
- System.out.println(owner.getFoo().getSomeValue());
- System.out.println(owner.getFoo().getOwner().getSomeOtherValue());
- em.getTransaction().commit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement