[hibernate-issues] [Hibernate-JIRA] Created: (HBX-730) SchemaExport with hibernate.hbm2ddl.auto does not create database schemas before it creates tables (fails with invalid schema name: on HSQLDB)
Andrew Thompson (JIRA)
noreply at atlassian.com
Wed Aug 16 12:04:19 EDT 2006
SchemaExport with hibernate.hbm2ddl.auto does not create database schemas before it creates tables (fails with invalid schema name: on HSQLDB)
-----------------------------------------------------------------------------------------------------------------------------------------------
Key: HBX-730
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-730
Project: Hibernate Tools
Type: Improvement
Environment: Hibernate 3.0.5, HSQLDB 1.8
I've also read the code in the SchemaExport, Table and Configuration classes in 3.2rc3 and it looks like this hasn't been added in 3.1 or 3.2.
Reporter: Andrew Thompson
I'm writing a unit test that creates the database it will work with using hibernate.hbm2ddl.auto=create-drop.
This all works fine, so long as I don't use schemas in my .hbm.xml:
<class name="com.example.Foo" table="foo_table">
If I add a schema like this, then the database creation fails on HSQLDB 1.8:
<class name="com.example.Foo" schema="bar" table="foo_table">
Unsuccessful: create table bar.foo_table ( ... column names ... )
hbm2ddl.SchemaExport - invalid schema name: BAR in statement [create table bar.foo_table]
As far as I know there is no way to ask Hibernate to create the schema before it tries to create the tables.
There is a forum thread here that shows I am not the only one with this issue:
http://forum.hibernate.org/viewtopic.php?p=2316411&sid=c0cd248a87bfb8d6846da315bb89775e
As this is a unit test, precreating the schema in the test code is plausible, but not particularly attractive.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list