Community
Participate
Working Groups
In the following testcase A has OneToOne cascade PERSIST to a B which has a OneToOne cascade PERSIST to an C. The following testcase will always fail. A a = new A(); a.setB(em.find(B.class, b_id)); C c = new C(); a.getB().setC(c); em.persist(a); assertTrue("Failed to cascade persist to 'C'", em.contains(c));
The issue is caused by uow.isObjectNew() checks in some mappings cascadeRegisterNewIfRequired methods which do not cascade the PERSIST unless the reference object is "new". This is in conflict with the requirements of the JPA specification.
Not a bug. The problem only existed because of a partial view update.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink