Hibernate 3.6: how to make use of deferred FK constraints when inserting entities with circular reference? Hibernate 3.6: how to make use of deferred FK constraints when inserting entities with circular reference? postgresql postgresql

Hibernate 3.6: how to make use of deferred FK constraints when inserting entities with circular reference?


What you have here is classical bidirectional relationship. both side has reference to each other. If you have bidirectonal one side need to be marked as the stronger side this is done by ussing mappedBy or inverse to mark the wick side. In addtional you have FK constraints , so need to define that not-null is true in order that hibernate will insert with the FK.

look on this for complete.