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

Description

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.

Environment

None

Activity

Show:
Christoph W.
February 11, 2011, 5:40 PM

the explained patch

Steve Ebersole
March 21, 2011, 7:09 PM

Bulk closing stale resolved issues

Assignee

Gail Badner

Reporter

Christoph W.

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Priority

Critical
Configure