Search
Duplicate
โ˜•

์˜์†์„ฑ์˜ ๋ฒ”์œ„

ํ™˜๊ฒฝ

โ€ข
OneToMany ๋‹จ๋ฐฉํ–ฅ
โ€ข
cascade persist
โ€ข
orphan removal = true
entityManager.getTransaction().begin(); entityManager.persist(morak); entityManager.flush(); entityManager.getTransaction().commit(); EntityManager entityManager2 = entityManagerFactory.createEntityManager(); entityManager2.getTransaction().begin(); morak.removeMember(0); entityManager2.flush(); entityManager2.getTransaction().commit(); entityManager.persist(eden);
Java
๋ณต์‚ฌ
โ†’ delete not working
entityManager2 ๊ด€๋ จ ๋ชจ๋‘ ๊ฑท์–ด๋‚ด๋ฉด
entityManager.getTransaction().begin(); entityManager.persist(morak); entityManager.flush(); entityManager.getTransaction().commit(); // EntityManager entityManager2 = entityManagerFactory.createEntityManager(); // entityManager2.getTransaction().begin(); morak.removeMember(0); // entityManager2.flush(); // entityManager2.getTransaction().commit(); // entityManager.persist(eden);
Markdown
๋ณต์‚ฌ
entityManager ์˜ commit ์ดํ›„์ด๋‹ค.