I have a question concerning Hibernate 3.6.7 and JPA 2.0.
Consider following entities (some getters and setters are omitted for brevity):
@Entity
pub
By using Java enterprise context in Wildfly (8.2.0-Final) (I think it's Hibernate version 4.3.7) the workaround for me was, to first persist the child an the add it to the lazy collection:
...
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void test(){
Child child = new Child();
child.setParent(parent);
childFacade.create(child);
parent.getChildren().add(cild);
parentFacade.edit(parent);
}