Guest User

Untitled

a guest
Nov 18th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. @Entity
  2. class A {
  3. //...
  4. }
  5.  
  6.  
  7. @Entity
  8. class B {
  9. @OneToMany
  10. List<A> list = new ArrayList<>();
  11. }
  12.  
  13. //функция обеспеч. постоянство
  14. @PersistenceContext(unitName = "db0")
  15. EntityManager em;
  16. EntityTransaction tx = em.getTransaction();
  17. A a = new A():
  18. B b = new B();
  19.  
  20. tx.begin();
  21. //..
  22. tx.commit();
Add Comment
Please, Sign In to add comment