-->
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: Strange same number of columns as the referenced key problem
PostPosted: Wed Mar 18, 2015 10:58 am 
Newbie

Joined: Wed Mar 18, 2015 10:33 am
Posts: 2
I get this message with hibernate using JPA 4.3.8.Final

Foreign key (FK_mitl23a09gupxss9kb02crjv9:Related [main_version])) must have same number of columns as the referenced primary key (Main [version,aaid])

These are the facts:

Hibernate
The problem does not appear when initiating hibernate via Hibernate's owne Session manager.

OpenEJB
The problem appears when initiating an embedded container using OpenEJB.
The problem disappears with OpenEJB if I remove any entity and its relations.

JBoss/Wildfly
The problem does NOT appear when deploying the code into Wildfly (Wildfly contains hibernate 4.3.6.Final)
The problem appears in Wildfly if I add a new entity even without any relations.

In both the Wildfly and OpenEJB cases, JPA finds the classes by scanning the classpath.

I am using derived keys, i.e. A has a one-to-many relation with B, then B has a one-to-many to C, so
A has pk=(a) and B has pk=(a,b) and C has pk=(a,b,c). There are more relations, but most references A directly
or indirectly.

Does anyone have any suggestions? I'm trying to cut away stuff so I can post something reasonable here, but so far removing anything make the issue disappear..


Top
 Profile  
 
 Post subject: Re: Strange same number of columns as the referenced key problem
PostPosted: Fri Mar 20, 2015 5:30 am 
Newbie

Joined: Wed Mar 18, 2015 10:33 am
Posts: 2
I uploaded a stripped down example at https://github.com/robinrosenberg/hibernatebughunt


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.