-->
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: about referencedColumnNames *not mapped to a single property
PostPosted: Thu Aug 14, 2008 11:15 pm 
Newbie

Joined: Thu Aug 07, 2008 10:09 am
Posts: 3
Hi all,

I hava four tables as following:
A( a_id(PK) , no)

B(b_id(PK),a_id,b_no)
a_id is FK reference to A; (a_id, b_no ) UNIQUE

C(c_id(PK),a_id,b_no,c_no)
a_id,b_no are FK reference to B;(a_id,b_no,c_no) UNIQUE

D(d_id(PK),a_id,b_no,c_no,d_no)
a_id,b_no,c_no are FK reference to C ;(a_id,b_no,c_no,d_no) UNIQUE

When i mapped A,B,C table with one-to-many ,that is OK;
But when i add the D table mapped, like
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumns( { @JoinColumn(name ="a_id",referencedColumnName= "a_id", nullable = false),
@JoinColumn(name ="b_no",referencedColumnName= "b_no", ),
@JoinColumn(name ="c_no",referencedColumnName= "c_no", nullable = false)})

it will throw annotationException :reference **** not mapped to a single property.
I don't know whether the Hibernate support more than four one-to-many cascade of FK.
Does anybody else know about this?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 14, 2008 11:19 pm 
Newbie

Joined: Thu Aug 07, 2008 10:09 am
Posts: 3
When i modify table D to reference to C with c_id(PK of table C)
that is ok.


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.