Author: max.andersen(a)jboss.com
Date: 2006-11-17 13:29:10 -0500 (Fri, 17 Nov 2006)
New Revision: 10841
Modified:
trunk/Hibernate3/src/org/hibernate/cfg/Configuration.java
Log:
HHH-2251 Settings build unnecessary in schemaupdate/schemavalidate
Modified: trunk/Hibernate3/src/org/hibernate/cfg/Configuration.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/cfg/Configuration.java 2006-11-16 22:26:22 UTC (rev
10840)
+++ trunk/Hibernate3/src/org/hibernate/cfg/Configuration.java 2006-11-17 18:29:10 UTC (rev
10841)
@@ -944,11 +944,11 @@
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
if ( table.isPhysicalTable() ) {
- Settings settings = buildSettings();
+
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- ( table.getSchema() == null ) ? settings.getDefaultSchemaName() :
table.getSchema(),
- ( table.getCatalog() == null ) ? settings.getDefaultCatalogName() :
table.getCatalog(),
+ ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
+ ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
table.isQuoted()
);
@@ -1062,16 +1062,19 @@
throws HibernateException {
secondPassCompile();
+ String defaultCatalog = properties.getProperty( Environment.DEFAULT_CATALOG );
+ String defaultSchema = properties.getProperty( Environment.DEFAULT_SCHEMA );
+
Iterator iter = getTableMappings();
while ( iter.hasNext() ) {
Table table = (Table) iter.next();
if ( table.isPhysicalTable() ) {
- Settings settings = buildSettings();
+
TableMetadata tableInfo = databaseMetadata.getTableMetadata(
table.getName(),
- ( table.getSchema() == null ) ? settings.getDefaultSchemaName() :
table.getSchema(),
- ( table.getCatalog() == null ) ? settings.getDefaultCatalogName() :
table.getCatalog(),
+ ( table.getSchema() == null ) ? defaultSchema : table.getSchema(),
+ ( table.getCatalog() == null ) ? defaultCatalog : table.getCatalog(),
table.isQuoted());
if ( tableInfo == null ) {
throw new HibernateException( "Missing table: " + table.getName() );