Author: stliu
Date: 2012-05-16 22:54:18 -0400 (Wed, 16 May 2012)
New Revision: 21029
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/Configuration.java
Log:
JBPAPP-8682 [HHH-5043] Incorrect handling of hibernate.default_schema in SchemaUpdate
Modified:
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/Configuration.java
===================================================================
---
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/Configuration.java 2012-04-15
10:38:33 UTC (rev 21028)
+++
core/branches/Branch_3_3_2_GA_CP/core/src/main/java/org/hibernate/cfg/Configuration.java 2012-05-17
02:54:18 UTC (rev 21029)
@@ -991,11 +991,12 @@
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
if ( table.isPhysicalTable() ) {
-
+ String tableSchema = ( table.getSchema() == null ) ? defaultSchema :
table.getSchema();
+ String tableCatalog = ( table.getCatalog() == null ) ? defaultCatalog :
table.getCatalog();
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
- ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
+ tableSchema,
+ tableCatalog,
table.isQuoted()
);
@@ -1004,8 +1005,8 @@
table.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
@@ -1014,8 +1015,8 @@
dialect,
mapping,
tableInfo,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
);
while ( subiter.hasNext() ) {
script.add( subiter.next() );
@@ -1034,11 +1035,12 @@
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
if ( table.isPhysicalTable() ) {
-
+ String tableSchema = ( table.getSchema() == null ) ? defaultSchema :
table.getSchema();
+ String tableCatalog = ( table.getCatalog() == null ) ? defaultCatalog :
table.getCatalog();
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- table.getSchema(),
- table.getCatalog(),
+ tableSchema,
+ tableCatalog,
table.isQuoted()
);
@@ -1059,8 +1061,8 @@
fk.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
@@ -1081,8 +1083,8 @@
index.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
Show replies by date