HBM2DD schema update and default schema with non-standard characters
Description
Activity

Brett Meyer January 10, 2016 at 1:33 AM
This area has changed drastically and this is likely no longer relevant for ORM 5. If it's still an issue, feel free to comment here!
Steve Ebersole October 28, 2015 at 3:25 AM
As part of verifying that this issue affects 5.0, please just set the "Affects version". Leave the "verify-affects-5.0" label and leave the issue in "Awaiting Response" status; these are critical for us to be able to track these verifications and triage them. Thanks.
Steve Ebersole October 27, 2015 at 7:14 PM
This bug report does not indicate that the reported issue affects version 5.x. Versions prior to 5.x are no longer maintained. It would be a great help to the Hibernate team and community for someone to verify that the reported issue still affects version 5.x. If so, please add the 5.x version that you verified with to the list of affected-versions and attach the (preferably SSCCE) test case you used to do the verification to the report; from there the issues will be looked at during our triage meetings.
For details, see http://in.relation.to/2015/10/27/great-jira-cleanup-2015/

Torben Riis March 26, 2014 at 5:30 AM
Hi, I have added a pull request #724. The test shows the unexpected behavior, but the fix is probably not an optimal solution.
I still believe that this should be handled by either hibernate.globally_quoted_identifiers, or with `my schema` as with annotations for database vendor specific escaping + plus some sort of un-escaping in org.hibernate.tool.hbm2ddl.DatabaseMetadata#getTableMetadata(). But I do not have the overview over the code base for a safe fix.

Brett Meyer March 25, 2014 at 1:42 PM
, I'd definitely be interested in seeing the test/fix in a pull request – thanks!
Details
Assignee
Brett MeyerBrett MeyerReporter
Torben RiisTorben RiisLabels
Components
Affects versions
Priority
Minor
Details
Details
Assignee

Reporter

I have been struggling with database schemas and hibernates default schema support (hibernate.default_schema). I use schema names that needs escaping, where schemas for H2 should be escaped with quotes e.g. “(my) weird schema-name” and for SQL Server with square brackets e.g. [(my) weird schema-name].
I followed some of the forum threads that states, you should just escape the schema name with quotes or square brackets before setting hibernate.default_schema. It kind of works. Every generated SQL statement now contains an escaped schema name. But….. Hbm2dll schema update doesn’t seem to work. The first startup successfully create all the tables, but the second startup writes a lot of error messages stating that the table already exists.
For further information see.
https://forum.hibernate.org/viewtopic.php?f=1&t=1031729
Since this is quite severe for our usage, we have forked hibernate 4.2.11, written a test that shows the error, and fixed it with fast fix that just removes the escaping before the invocation to org.hibernate.tool.hbm2ddl.DatabaseMetadata#getTableMetadata(). It is building on our CI environment and is added to our repository.
Would you accept such a pull request?