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

A SQLServer table with spaces doesn't work with the @JoinTable Annotation

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: 4.2.18, 4.3.11, 5.0.0.Final
    • Fix versions: None
    • Components: hibernate-core
    • Environment:
      4.2.18, SQLServer 2012
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Suitable for new contributors:
      Yes, likely
    • Last commented by a user?:
      true
    • Sprint:

      Description

      I have a @ManyToOne Association that uses an @JoinTable with a name that has spaces. Normal @Table(name=...) and @Column(name=...) syntax allows this to work in a variety of ways ([Table Name],`Table Name`, and \"Table Name\"). None of these work and Hibernate throws a "Cannot find the expected secondary table" error. Attaching stacktrace.

      If I create a view of the table with underscores, using wrapping characters are not required and the join works.

      It should be noted that this works in 3.4.0.GA, the JBoss 5.1 default version. I've tried the versions listed and getting the same error.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              daniel9x Daniel Grant
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: