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
|