Entity A that contains: {code:java} @NotFound(action = NotFoundAction.IGNORE) @OneToOne(mappedBy = "a") private B b; {code}
Entity B that contains: {code:java} @OneToOne @JoinTable(name = JOIN_TABLE, joinColumns = @JoinColumn(name = COLUMN_CASE_PRIMARY_KEY), inverseJoinColumns = @JoinColumn(name = COLUMN_CASE_PRIMARY_KEY_SIDE)) private A a; {code}
Trying persist an object A wth b B with a = null , causes the following exception
{code:java} 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) {code} |
|