Community
Participate
Working Groups
Build Identifier: 20100218-1602 (Eclipselink 2.1.1) I've got exactly the same problem as described in http://www.eclipse.org/forums/index.php?t=tree&th=124961& Eclipselink should detect this special case and either not do a shallow commit or update the foreign key in a second query as it would do for other circular references. Reproducible: Always Steps to Reproduce: See the newsgroup post http://www.eclipse.org/forums/index.php?t=tree&th=124961&
Please post, at least, a description of the problem in the bug.
Problem description: I have the following: @Entity public class User { @Id @GeneratedValue(strategy = SEQUENCE) @Column(name = "id", nullable = false, updatable = false) private Long id = null; @OneToOne @JoinColumn(name = "created_by", updatable = false, nullable = false) private User createdBy; ... } Then I persist it User u = new User(); u.setCreatedBy(u); em.persist(u); As you see the user creator is himself. I get the error of: Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "created_by" violates not-null constraint EclipseLink generates an SQL statement with CREATED_BY = NULL. This happens even if I manually set an ID for the User.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink