Issue Type: Bug Bug
Affects Versions: 4.2.2
Assignee: Unassigned
Attachments: Animal.hbm.xml, Animal.java, Cat.hbm.xml, Cat.java, Person.hbm.xml, Person.java
Created: 24/May/13 3:31 AM
Description:

HHH-1904 and HHH-8217 still not fixed in 4.2.2

union-subclass mapping generates foreign key constraint name too long
org.hibernate.mapping.DenormalizedTable.createForeignKeys() concatenates FK name (generated with parent class table name) with hash of the current table name.
It results in a > 30 chars long FK name.
Running SchemaExport.execute(Target.EXPORT, Type.CREATE) with simple Animal/Cat/Person mapping joined :

[main] 2013-05-24 12:23:11,023 DEBUG :
create table CAT (
ID numeric(18,0) not null,
OWNER numeric(18,0) not null,
COLOR varchar(255),
primary key (ID)
)
.[main] 2013-05-24 12:23:11,064 DEBUG :
create table PERSON (
ID numeric(18,0) not null,
NAME varchar(255),
primary key (ID)
)
[main] 2013-05-24 12:23:11,114 DEBUG :
alter table CAT
add constraint FK_sikm6d1tc9th079dp3bgfuxk7103b6
foreign key (OWNER)
references PERSON
[main] 2013-05-24 12:23:11,134 ERROR : HHH000389: Unsuccessful: alter table CAT add constraint FK_sikm6d1tc9th079dp3bgfuxk7103b6 foreign key (OWNER) references PERSON
[main] 2013-05-24 12:23:11,134 ERROR : GDS Exception. 335544351. unsuccessful metadata update
Name longer than database column size

Environment: Jdk 1.7
Firebird 2.5
Project: Hibernate ORM
Priority: Blocker Blocker
Reporter: Aurelien DROUARD
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira