eclipse-ee4j/eclipselink

JPA 4.0.2 - merge nulls out Entity during second iteration

Closed this issue · 1 comments

Test case can be found here: https://github.com/mores/maven-examples/tree/master/eclipse

There exists a One to Many relationship, if you execute the test case the first time everything persists as it should.

firstRun.txt

The BUG shows up when you try and execute this a second time - it tries to null out the entity - even though it has been set.

secondRun.txt

Hello I see issue with:

public class S {
...
@OneToMany

there should be

public class S {
...
@OneToMany(mappedBy = "s")

See https://jakarta.ee/specifications/persistence/3.1/apidocs/jakarta.persistence/jakarta/persistence/onetomany#mappedBy()