Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.0.cr2
    • Fix Version/s: 4.3.0.Beta1, 4.2.1
    • Component/s: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      I'm following up form HHH-355 Closed , basically, foreign keys with names that go well beying 30 chars of lenght.
      I know how to reproduce the problem, and if required I can provide a test case, but let me point you to
      the code path that generates the problem first (and see if that's enough).

      I do have a hierarchy mapped with the table per class approach, with intermediate abstract classes.
      Leaf classes of this hierarchy are apparently managed in hibernate usign the DenormalizedTable class. The code that generates the foreign keys for this class is:

      public void createForeignKeys() {
      includedTable.createForeignKeys();
      Iterator iter = includedTable.getForeignKeyIterator();
      while ( iter.hasNext() ) {
      ForeignKey fk = (ForeignKey) iter.next();
      createForeignKey(
      fk.getName() + Integer.toHexString( getName().hashCode() ),
      fk.getColumns(),
      fk.getReferencedEntityName()
      );
      }
      }

      As you can see, it gets the foreign key name of the contained class, and appends another hexstring. This name can become really long if the
      hierarchy has many levels. In my case I get names as long as: FK14F780C41886F83e63ff56e238e868d73630607.

      Let me know if this is enough or if you need more information.
      Ah, another problem is that the appended foreign parts do not pass thru the naming strategy, and as you can see they're not
      uppercase in my sample (my naming strategy does uppercase everything)

        Attachments

          Issue links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: