Uploaded image for project: 'Hibernate ORM'
  1. HHH-8269

DenormalizedTable FK constraint names can be too long

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.2.2
    • Fix Version/s: 4.3.0.Beta3, 4.2.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Jdk 1.7
      Firebird 2.5
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      HHH-1904 Closed and HHH-8217 Closed 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

        Attachments

        1. Animal.hbm.xml
          0.5 kB
        2. Animal.java
          0.4 kB
        3. Cat.hbm.xml
          0.4 kB
        4. Cat.java
          0.2 kB
        5. Person.hbm.xml
          0.5 kB
        6. Person.java
          0.4 kB

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: