since you're using the mappedBy attribute your code should look something like: Order order = ...; | OrderLine ol1 = ...; | OrderLine ol2 = ...; | | ol1.setParentOrder(order); | ol2.setParentOrder(order); | | Collection<OrderLine> orderLines = order.getOrderLines(); | orderLines.add(ol1); | orderLines.add(ol2); | | order.setOrderLines(orderLines); | | ----------------- | //save code | em.persist(order); //or em.merge(order) | |
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103426#4103426 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103426 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user