Entity A that contains: @NotFound(action = NotFoundAction.IGNORE) @OneToOne(mappedBy = "a") private B b; Entity B that contains: @OneToOne @NotFound(action = NotFoundAction.IGNORE) @JoinTable(name = JOIN_TABLE, joinColumns = @JoinColumn(name = COLUMN_CASE_PRIMARY_KEY), inverseJoinColumns = @JoinColumn(name = COLUMN_CASE_PRIMARY_KEY_SIDE)) private A a; When I try to persist an object A wth b = null, I got the following exception org.hibernate.PropertyValueException: not-null property references a null or transient value : at org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:92) at org.hibernate.action.internal.AbstractEntityInsertAction.nullifyTransientReferencesIfNotAlready(AbstractEntityInsertAction.java:115) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:69) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:623) |
|