-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping a table with two separate classes causing an error
PostPosted: Thu Nov 17, 2011 10:53 am 
Newbie

Joined: Wed Jul 08, 2009 8:11 am
Posts: 8
Hi. I have a table XYZ. I have a mapping for XYZ (XYZ.java, XYZ.hbm.xml) where I map all of XYZ's columns and where its <id> is a single native ID on the table.
I have another mapping called XYZLink.java / XYZLink.hbm.xml where I also map to table XYZ, but this time with a <composite-id> composed of 3 columns from the table.

Now, if I add both XYZ and XYZLink to the configuration, I get an error "Error aligning FK columns, may be ignorable".

Why does the presence of XYZLink seem to cache within Hibernate that the key of this table is the composite key in XYZLink.hbm.xml? I mean, they are two separate classes, two separate mappings... it seems Hibernate is actually storing information about this table using the underlying table name. That doesn't seem right.

If I remove XYZLink.java from the configuration, the error message goes away.

What do you guys think?


Top
 Profile  
 
 Post subject: Re: Mapping a table with two separate classes causing an error
PostPosted: Thu Nov 17, 2011 11:27 am 
Newbie

Joined: Wed Jul 08, 2009 8:11 am
Posts: 8
I seem to have gotten around the problem by putting "foreign-key="ignore"" in the <set mapping that was causing the error to be displayed.


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

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.