[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5918) generate schema update script does not respect default schema and default catalog when querying foreign key contraints

Christoph Weißenborn (JIRA) noreply at atlassian.com
Fri Feb 11 10:40:05 EST 2011


generate schema update script does not respect default schema and default catalog when querying foreign key contraints
----------------------------------------------------------------------------------------------------------------------

                 Key: HHH-5918
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5918
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.6.1, 3.6.0, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0-Final, 3.3.2, 3.3.1, 3.3.0.SP1, 3.2.7, 3.2.6, 3.2.5, 3.2.4.sp1, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.1.3, 3.1.2, 3.1.1, 3.1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final
            Reporter: Christoph Weißenborn
            Priority: Critical


When starting session factoring with mode "allow schema update" the database is inspected.
Table structures are queried within correct schema and catalog. But foreign key constraints and indexes were not. If a index/foreign key is defined in another schema at the same sql server, the index/foreign key is not created in the current schema.

The fix is very easy.
org.hibernate.cfg.Configuration (revision 20769), method generateSchemaUpdateScript(Dialect, DatabaseMetadata):
In line 1174 und 1175 use default schema und catalog if not specified for the table. This metadata is used for table structures.
Copy these 2 lines to 1217 und 1218 where the default schema and catalog is _not_ used when not specified for the table. This metadata is used for foreign key and indexes.


-- 
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