-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Optional, primary key, one-to-one no longer working in 3.5.4
PostPosted: Mon Aug 02, 2010 8:17 pm 
Newbie

Joined: Tue Sep 08, 2009 7:38 pm
Posts: 6
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.