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

When "schema" attribute is set explicitly, tables are identified by schema name even when underlying database doesn't support schemas

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.7
    • Fix Version/s: 5.2.8
    • Component/s: hibernate-core
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • backPortable:
      Backport?
    • Last commented by a user?:
      true

      Description

      We are using two different databases for production (DB2) and testing (MySQL). I have declared my entity as

      @Entity
      @Table(name="BUILDVERSION", schema="DFT")
      public class BuildVersion {
      	...
      }
      

      Note that we have set hibernate.hbm2ddl.auto to update.

      Now the following step produces the error: (we are targeting MySQL now)

      • Modify the entity structure by adding new column.
      • Thus, upon the next start, hibernate will try to update the database model.
      • Since we have declared schema name, hibernate will create update query for table "DFT.BUILDVERSION", which is not a valid object for MySQL.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: