-->
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: FK Constraint Name
PostPosted: Tue Oct 16, 2007 7:29 pm 
Newbie

Joined: Wed Oct 10, 2007 12:26 pm
Posts: 5
Location: Santa Clara
Hi,
I have an @OneToOne unidirection association from ATABLE ---> BTABLE. As such have created the @JoinColumns with column name and referencedColumn name.
I also gave @ForeignKey (name="CONS_NAME_FK")

When I tried to deploy it, the table creation was done successfull, but then when it is trying to do a "alter table "


ERROR [SchemaExport] Unsuccessful: alter table ATABLE add constraint CONS_NAME_FKa89a60cc3163b394 foreign key (AID, BID, CID, DID) references BTABLE
ERROR [SchemaExport] ORA-00972: identifier is too long

Sample code:
Class ATABLE{

@OneToOne(cascade = CascadeType.ALL)
@ForeignKey (name = "CONS_NAME_FK")
@JoinColumns ({@JoinColumn(name = "AID", referencedColumnName= "AID"),
@JoinColumn (name = "BID", referencedColumnName= "BID"),
@JoinColumn (name = "CID", referencedColumnName= "CID"),
@JoinColumn (name = "DID", referencedColumnName= "DID")})

private BTABLE bTable;

}
Can anyone please help me with what i could go wrong?
Even after specifying the name of the constraint, it still appends the extra hexstring, and generates the name, and that being too long, getting such errors.

Any help would be appreciated.
thanks
Kuga


Top
 Profile  
 
 Post subject: URGENT !!!! Re: FK Constraint Name
PostPosted: Wed Oct 17, 2007 1:30 pm 
Newbie

Joined: Wed Oct 10, 2007 12:26 pm
Posts: 5
Location: Santa Clara
Hi Experts,
Should I assume that this is a bug, or please let me know, i am unable to proceed.
thanks
Kuga


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.