Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- class A {
- //...
- }
- @Entity
- class B {
- @OneToMany
- List<A> list = new ArrayList<>();
- }
- //функция обеспеч. постоянство
- @PersistenceContext(unitName = "db0")
- EntityManager em;
- EntityTransaction tx = em.getTransaction();
- A a = new A():
- B b = new B();
- tx.begin();
- //..
- tx.commit();
Add Comment
Please, Sign In to add comment