| During an upgrade from hibernate 4.3.11 to 5.X I ran into a couple of test failures. I have attached a simplified version of the test. After some debugging I figured out the following things: After upgrading to a version >=5, the test not longer runs due to the "schema" not being created. Even when setting the options:
- AvailableSettings.HBM2DDL_AUTO to "update"
- AvailableSettings.HBM2DLL_CREATE_SCHEMAS to "true"
the schema does not get created. It also doesn't matter whether or not I use "update" or "create" or "drop-and-create".
I can work around this issue by using: "jdbc:h2:mem:;INIT=create schema IF NOT EXISTS bug" instead of just "jdbc:h2:mem:", however that shouldn't be necessary in my opinion. I also figured out "why" it works with version 4.3.11. versions < 5 do not check for the schema in the Entity tag. They will simply create the corresponding table in the public schema and be done with it. When there are two Entities with the same table name but different schema their columns get merged into one. |