[hibernate-issues] [Hibernate-JIRA] Created: (HBX-1064) hibernate.hbm2ddl.auto=update skip a superclass table creation
Bartolomeo Romano (JIRA)
noreply at atlassian.com
Thu Jun 5 14:03:33 EDT 2008
hibernate.hbm2ddl.auto=update skip a superclass table creation
--------------------------------------------------------------
Key: HBX-1064
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1064
Project: Hibernate Tools
Issue Type: Bug
Components: eclipse
Environment: Spring, Postgres 8.1.4, Hibernate 3.2.0 cr2
Reporter: Bartolomeo Romano
hbm2ddl=auto doesn't create a table with the same name of another table wich already exist in the DB but on an another Schema.
The wierd thing is that it does create that table on another (a third) schema.
Looking the log it seems that hibernate doesn't even notice there is that table to create even if when it resolves the references for the classes it sees the class.
This is the class not created:
<hibernate-mapping auto-import="false" default-lazy="false" schema="trackmatch" >
<class name="com.unique.trackmatch.security.GroupRoles" table="group_roles">
<id name="id">
<column name="id" sql-type="char(32)" not-null="true" unique="true"/>
<generator class="uuid.hex"/>
</id>
<set name="trackMatchManagerGroups" table="trackmatch_manager_groups">
<key>
<column name="group_roles_id" sql-type="char(32)"/>
</key>
<many-to-many class="com.unique.cmf.user.Group">
<column name="group_id" sql-type="char(32)"/>
</many-to-many>
</set>
</class>
</hibernate-mapping>
The other table has the same name but it's in a different schema of the same DataBase
This is the log I get:
19:02:00,250 [main] DEBUG SchemaUpdate.debug() - create table trackmatch.trackmatch_manager_groups (group_roles_id char(32) not null, group_id char(32) not null, primary key (group_roles_id, group_id))
19:02:00,265 [main] DEBUG SchemaUpdate.debug() - alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2BC81D8925 foreign key (group_roles_id) references trackmatch.group_roles
19:02:00,265 [main] ERROR SchemaUpdate.error() - Unsuccessful: alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2BC81D8925 foreign key (group_roles_id) references trackmatch.group_roles
19:02:00,281 [main] ERROR SchemaUpdate.error() - ERROR: relation "trackmatch.group_roles" does not exist
19:02:00,281 [main] DEBUG SchemaUpdate.debug() - alter table trackmatch.trackmatch_manager_groups add constraint FKF887CA2B84BBA459 foreign key (group_id) references usergroup.groups
At the end it creates the class defined in the <set> but not the super class nor the foreign.
If I change the table's name it works fine.
--
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