Author: stliu
Date: 2012-04-15 06:38:33 -0400 (Sun, 15 Apr 2012)
New Revision: 21028
Modified:
core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-8683/core/src/main/java/org/hibernate/cfg/Configuration.java
Log:
JBPAPP-8683 [HHH-5043] Incorrect handling of hibernate.default_schema in SchemaUpdate
Modified:
core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-8683/core/src/main/java/org/hibernate/cfg/Configuration.java
===================================================================
---
core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-8683/core/src/main/java/org/hibernate/cfg/Configuration.java 2012-04-15
10:13:31 UTC (rev 21027)
+++
core/patches/hibernate-3.3.2.GA_CP04_JBPAPP-8683/core/src/main/java/org/hibernate/cfg/Configuration.java 2012-04-15
10:38:33 UTC (rev 21028)
@@ -990,13 +990,15 @@
Iterator iter = getTableMappings();
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
+ String tableSchema = ( table.getSchema() == null ) ? defaultSchema : table.getSchema()
;
+ String tableCatalog = ( table.getCatalog() == null ) ? defaultCatalog :
table.getCatalog();
if ( table.isPhysicalTable() ) {
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
- ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
- table.isQuoted()
+ tableSchema,
+ tableCatalog,
+ table.isQuoted()
);
if ( tableInfo == null ) {
@@ -1004,8 +1006,8 @@
table.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
@@ -1014,8 +1016,8 @@
dialect,
mapping,
tableInfo,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
);
while ( subiter.hasNext() ) {
script.add( subiter.next() );
@@ -1033,12 +1035,14 @@
iter = getTableMappings();
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
+ String tableSchema = ( table.getSchema() == null ) ? defaultSchema : table.getSchema()
;
+ String tableCatalog = ( table.getCatalog() == null ) ? defaultCatalog :
table.getCatalog();
if ( table.isPhysicalTable() ) {
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- table.getSchema(),
- table.getCatalog(),
+ tableSchema,
+ tableCatalog,
table.isQuoted()
);
@@ -1059,8 +1063,8 @@
fk.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
@@ -1081,8 +1085,8 @@
index.sqlCreateString(
dialect,
mapping,
- defaultCatalog,
- defaultSchema
+ tableCatalog,
+ tableSchema
)
);
}
Show replies by date