-->
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: Can't use Relationship referencing another relationship
PostPosted: Thu Feb 27, 2014 8:52 am 
Newbie

Joined: Thu Feb 27, 2014 8:19 am
Posts: 1
HI,

I am using JPA on Wildfly 8.0 with Hibernate 4.3, here's what I'm trying to do:

I have a ManyToOne in relationship class C that I want to reference yet another OneToOne relationship in class B which references a column in class A.


So when I try it, I get the error:
A Foreign key refering com.amyaj.emedical.entities.patient.ehr.B from com.amyaj.emedical.entities.patient.ehr.C has the wrong number of column. should be 0
Which is the exact same problem exposed here 3 years ago: http://stackoverflow.com/questions/3653315/hibernate-foreign-key-has-the-wrong-number-of-column-should-be-0

So, if I understand, a relationship is not considered as a column (in my case: the OneToOne relationship in class B).

Is there a turnaround for this? I would like to avoid the redundancy of having two identical columns in the database (one for the ID and the other for the OneToOne)

Thanks a lot.

Edit: Typo


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.