We just upgraded to 3.5.4 from 3.3.2 (Core).
We have an entity class called PerOrg (short for Person/Organisation) which has relationships to several optional 'role' entities. These relationships are one-to-one based on the primary key (an assigned string 'id').
Each relationship is defined in the 'PerOrg' class similar to the following:
@OneToOne(fetch = FetchType.EAGER, optional = true) @PrimaryKeyJoinColumn @Updated private Supplier supplier;
In the previous version of Hibernate, this was fine, but with the new version the schema update fails because it tries to add a foreign key constraint between PerOrg and the related roles. Of course this fails because no PerOrg has ALL the roles associated with it.
We have reverted the version of Hibernate back for just now, but we'd like to know why this is happening in the new version.
BTW, I will listen to entity relationship design arguments, but that's not the point. Our system was working perfectly before this change to Hibernate.
Cheers, Duncan.
|