c1.setD(d1);
d1.setC(c1);
}
Publisher p1 = new Publisher();
p1.setName("publisher1");
em.persist(p1);
for (int i = 0; i < 4; i++) {
Magazine magazine = new Magazine();
magazine.setIdPublisher(p1);
magazine.setName("magagine"+i+"_"+p1.getName());
em.persist(magazine);
}
Publisher p2 = new Publisher();
p2.setName("publisher2");
em.persist(p2);
for (int i = 0; i < 4; i++) {
Magazine magazine = new Magazine();
magazine.setIdPublisher(p2);
magazine.setName("magagine"+i+"_"+p2.getName());
em.persist(magazine);
}
em.flush();
em.getTransaction().commit();