Hibernate SVN: r20877 - in tools/trunk/src: java/org/hibernate/cfg/reveng and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-01-18 07:15:04 -0500 (Tue, 18 Jan 2011)
New Revision: 20877
Added:
tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java
Modified:
tools/trunk/src/java/org/hibernate/cfg/JDBCBinder.java
tools/trunk/src/java/org/hibernate/cfg/reveng/AbstractDatabaseCollector.java
tools/trunk/src/java/org/hibernate/cfg/reveng/DefaultDatabaseCollector.java
tools/trunk/src/java/org/hibernate/cfg/reveng/JDBCReader.java
tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java
tools/trunk/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java
tools/trunk/src/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java
tools/trunk/src/test/org/hibernate/tool/BaseTestCase.java
tools/trunk/src/test/org/hibernate/tool/hbm2x/CachedMetaDataTest.java
tools/trunk/src/test/org/hibernate/tool/hbm2x/IncrementalSchemaReadingTest.java
tools/trunk/src/test/org/hibernate/tool/test/DriverMetaDataTest.java
Log:
https://issues.jboss.org/browse/JBIDE-6396
Updated Database collector work with quoted identifiers
Modified: tools/trunk/src/java/org/hibernate/cfg/JDBCBinder.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/JDBCBinder.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/JDBCBinder.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -21,9 +21,8 @@
import org.hibernate.DuplicateMappingException;
import org.hibernate.FetchMode;
import org.hibernate.MappingException;
-import org.hibernate.cfg.reveng.DatabaseCollector;
-import org.hibernate.cfg.reveng.ForeignKeyCollectionInfo;
import org.hibernate.cfg.reveng.AssociationInfo;
+import org.hibernate.cfg.reveng.DatabaseCollector;
import org.hibernate.cfg.reveng.JDBCReader;
import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
import org.hibernate.cfg.reveng.MappingsDatabaseCollector;
@@ -39,9 +38,9 @@
import org.hibernate.mapping.ForeignKey;
import org.hibernate.mapping.KeyValue;
import org.hibernate.mapping.ManyToOne;
-import org.hibernate.mapping.OneToOne;
import org.hibernate.mapping.MetaAttribute;
import org.hibernate.mapping.OneToMany;
+import org.hibernate.mapping.OneToOne;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
@@ -117,7 +116,7 @@
schema = schema!=null ? schema : settings.getDefaultSchemaName();
JDBCReader reader = JDBCReaderFactory.newJDBCReader(cfg.getProperties(),settings,revengStrategy);
- DatabaseCollector dbs = new MappingsDatabaseCollector(mappings);
+ DatabaseCollector dbs = new MappingsDatabaseCollector(mappings, reader.getMetaDataDialect());
reader.readDatabaseSchema(dbs, catalog, schema);
return dbs;
}
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/AbstractDatabaseCollector.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/AbstractDatabaseCollector.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/AbstractDatabaseCollector.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -3,13 +3,17 @@
import java.util.HashMap;
import java.util.Map;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
+
public abstract class AbstractDatabaseCollector implements DatabaseCollector {
private Map oneToManyCandidates;
protected final Map suggestedIdentifierStrategies;
+ private MetaDataDialect metaDataDialect;
- public AbstractDatabaseCollector() {
+ public AbstractDatabaseCollector(MetaDataDialect metaDataDialect) {
suggestedIdentifierStrategies = new HashMap();
+ this.metaDataDialect = metaDataDialect;
}
public void setOneToManyCandidates(Map oneToManyCandidates) {
@@ -29,5 +33,19 @@
TableIdentifier identifier = new TableIdentifier(catalog, schema, name);
suggestedIdentifierStrategies.put(identifier, idstrategy);
}
+
+ protected String quote(String name) {
+ if (name == null)
+ return name;
+ if (metaDataDialect.needQuote(name)) {
+ if (name.length() > 1 && name.charAt(0) == '`'
+ && name.charAt(name.length() - 1) == '`') {
+ return name; // avoid double quoting
+ }
+ return "`" + name + "`";
+ } else {
+ return name;
+ }
+ }
}
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/DefaultDatabaseCollector.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/DefaultDatabaseCollector.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/DefaultDatabaseCollector.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -6,6 +6,7 @@
import java.util.List;
import java.util.Map;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
import org.hibernate.mapping.Table;
import org.hibernate.util.StringHelper;
@@ -13,13 +14,13 @@
private Map tables;
private Map qualifiers;
- public DefaultDatabaseCollector() {
+
+ public DefaultDatabaseCollector(MetaDataDialect metaDataDialect) {
+ super(metaDataDialect);
tables = new HashMap();
- qualifiers = new HashMap();
+ qualifiers = new HashMap();
}
-
-
public Iterator iterateTables() {
return tables.values().iterator();
}
@@ -28,7 +29,7 @@
String catalog,
String name) {
- String key = Table.qualify(catalog, schema, name);
+ String key = Table.qualify(quote(catalog), quote(schema), quote(name));
Table table = (Table) tables.get(key);
if (table == null) {
@@ -55,11 +56,13 @@
}
public Table getTable(String schema, String catalog, String name) {
- String key = Table.qualify(catalog, schema, name);
+ String key = Table.qualify(quote(catalog), quote(schema), quote(name));
return (Table) tables.get(key);
}
public Iterator getQualifierEntries() {
return qualifiers.entrySet().iterator();
}
+
+
}
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/JDBCReader.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/JDBCReader.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/JDBCReader.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -549,7 +549,7 @@
}
log.debug("Adding table " + tableName + " of type " + tableType);
progress.startSubTask("Found " + tableName);
- Table table = dbs.addTable(quote(getSchemaForModel(schemaName)), getCatalogForModel(catalogName), quote(tableName));
+ Table table = dbs.addTable(getSchemaForModel(schemaName), getCatalogForModel(catalogName), tableName);
table.setComment(comment);
if(tableType.equalsIgnoreCase("TABLE")) {
hasIndices.add(table);
@@ -668,7 +668,7 @@
}
- private String quote(String columnName) {
+ private String quote(String columnName) {
if(columnName==null) return columnName;
if(getMetaDataDialect().needQuote(columnName)) {
if(columnName.length()>1 && columnName.charAt(0)=='`' && columnName.charAt(columnName.length()-1)=='`') {
@@ -680,7 +680,7 @@
}
}
- private MetaDataDialect getMetaDataDialect() {
+ public MetaDataDialect getMetaDataDialect() {
return metadataDialect;
}
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -3,13 +3,15 @@
import java.util.Iterator;
import org.hibernate.cfg.Mappings;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
import org.hibernate.mapping.Table;
public class MappingsDatabaseCollector extends AbstractDatabaseCollector {
private final Mappings mappings;
- public MappingsDatabaseCollector(Mappings mappings) {
+ public MappingsDatabaseCollector(Mappings mappings, MetaDataDialect metaDataDialect) {
+ super(metaDataDialect);
this.mappings = mappings;
}
@@ -18,11 +20,11 @@
}
public Table addTable(String schema, String catalog, String name) {
- return mappings.addTable(schema, catalog, name, null, false);
+ return mappings.addTable(quote(catalog), quote(schema), quote(name), null, false);
}
public Table getTable(String schema, String catalog, String name) {
- return mappings.getTable(schema, catalog, name);
+ return mappings.getTable(quote(catalog), quote(schema), quote(name));
}
}
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -14,7 +14,6 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.cfg.JDBCBinderException;
import org.hibernate.cfg.reveng.ReverseEngineeringRuntimeInfo;
-import org.hibernate.connection.ConnectionProvider;
import org.hibernate.exception.SQLExceptionConverter;
import org.hibernate.util.StringHelper;
@@ -145,6 +144,7 @@
// TODO: use jdbc metadata to decide on this. but for now we just handle the most typical cases.
if(name.indexOf('-')>0) return true;
if(name.indexOf(' ')>0) return true;
+ if(name.indexOf('.')>0) return true;
return false;
}
Modified: tools/trunk/src/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java
===================================================================
--- tools/trunk/src/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/java/org/hibernate/tool/hbmlint/detector/SchemaByMetaDataDetector.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -11,7 +11,6 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.JDBCReaderFactory;
import org.hibernate.cfg.Settings;
-import org.hibernate.cfg.reveng.AbstractDatabaseCollector;
import org.hibernate.cfg.reveng.DatabaseCollector;
import org.hibernate.cfg.reveng.DefaultDatabaseCollector;
import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
@@ -63,7 +62,7 @@
new DefaultReverseEngineeringStrategy() );
reader = JDBCReaderFactory.newJDBCReader( cfg.getProperties(),
settings, tableSelector );
- dbc = new DefaultDatabaseCollector();
+ dbc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
mapping = cfg.buildMapping();
}
Modified: tools/trunk/src/test/org/hibernate/tool/BaseTestCase.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/BaseTestCase.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/test/org/hibernate/tool/BaseTestCase.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -149,7 +149,7 @@
JDBCMetaDataDialect dialect = new JDBCMetaDataDialect();
- dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(testSettings.getConnectionProvider(), testSettings.getSQLExceptionConverter(), new DefaultDatabaseCollector()));
+ dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(testSettings.getConnectionProvider(), testSettings.getSQLExceptionConverter(), new DefaultDatabaseCollector(dialect)));
Iterator tables = dialect.getTables( testSettings.getDefaultCatalogName(), testSettings.getDefaultSchemaName(), null );
assertHasNext( 0, tables );
Modified: tools/trunk/src/test/org/hibernate/tool/hbm2x/CachedMetaDataTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/hbm2x/CachedMetaDataTest.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/test/org/hibernate/tool/hbm2x/CachedMetaDataTest.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -124,7 +124,7 @@
JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), dialect );
- DatabaseCollector dc = new DefaultDatabaseCollector();
+ DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
reader.readDatabaseSchema( dc, null, null );
validate( dc );
@@ -133,7 +133,7 @@
reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), dialect );
- dc = new DefaultDatabaseCollector();
+ dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
reader.readDatabaseSchema( dc, null, null );
validate(dc);
Added: tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java (rev 0)
+++ tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.tool.hbm2x;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.cfg.JDBCMetaDataConfiguration;
+import org.hibernate.cfg.JDBCReaderFactory;
+import org.hibernate.cfg.Settings;
+import org.hibernate.cfg.reveng.DatabaseCollector;
+import org.hibernate.cfg.reveng.DefaultDatabaseCollector;
+import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
+import org.hibernate.cfg.reveng.JDBCReader;
+import org.hibernate.cfg.reveng.OverrideRepository;
+import org.hibernate.cfg.reveng.SchemaSelection;
+import org.hibernate.cfg.reveng.TableIdentifier;
+import org.hibernate.cfg.reveng.dialect.MetaDataDialect;
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.PostgreSQLDialect;
+import org.hibernate.mapping.Table;
+import org.hibernate.tool.JDBCMetaDataBinderTestCase;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class DefaultDatabaseCollectorTest extends JDBCMetaDataBinderTestCase {
+
+ private static final String SCHEMA = "cat.cat";
+
+ private static final String QSCHEMA = "\"cat.cat\"";
+
+ public void testReadOnlySpecificSchema() {
+
+ JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
+
+ OverrideRepository or = new OverrideRepository();
+ or.addSchemaSelection(new SchemaSelection(null, SCHEMA));
+ configuration.setReverseEngineeringStrategy(or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
+ configuration.readFromJDBC();
+
+ List tables = getTables(configuration);
+
+ assertEquals(2,tables.size());
+
+ Table catchild = (Table) tables.get(0);
+ Table catmaster = (Table) tables.get(1);
+
+ System.out.println(catchild);
+ System.out.println(catmaster);
+
+ if(catchild.getName().equals("cat.master")) {
+ catchild = (Table) tables.get(1);
+ catmaster = (Table) tables.get(0);
+ }
+
+ TableIdentifier masterid = TableIdentifier.create(catmaster);
+ TableIdentifier childid = TableIdentifier.create(catchild);
+
+ assertEquals(new TableIdentifier(null, "cat.cat", "cat.child"), childid);
+ assertEquals(new TableIdentifier(null, "cat.cat", "cat.master"), masterid);
+ }
+
+ public void testNeedQuote() {
+ Settings buildSettings = cfg.buildSettings();
+
+ MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( buildSettings.getDialect(), cfg.getProperties() );
+ assertTrue("The name must be quoted!", realMetaData.needQuote(SCHEMA));
+ assertTrue("The name must be quoted!", realMetaData.needQuote("cat.child"));
+ assertTrue("The name must be quoted!", realMetaData.needQuote("cat.master"));
+ }
+
+ /**
+ * There are 2 solutions:
+ * 1. DatabaseCollector#addTable()/getTable() should be called for not quoted parameters - I think it is preferable way.
+ * 2. DatabaseCollector#addTable()/getTable() should be called for quoted parameters - here users should
+ * use the same quotes as JDBCReader.
+ * Because of this there are 2 opposite methods(and they are both failed as addTable uses quoted names
+ * but getTable uses non-quoted names )
+ */
+ public void testQuatedNamesAndDefaultDatabaseCollector() {
+ Settings buildSettings = cfg.buildSettings();
+
+ MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( buildSettings.getDialect(), cfg.getProperties() );
+
+ JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), realMetaData );
+
+ DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
+ reader.readDatabaseSchema( dc, null, SCHEMA );
+
+ assertNotNull("The table should be found", dc.getTable(SCHEMA, null, "cat.child"));
+ assertNotNull("The table should be found", dc.getTable(SCHEMA, null, "cat.master"));
+ assertNull("Quoted names should not return the table", dc.getTable(quote(SCHEMA), null, quote("cat.child")));
+ assertNull("Quoted names should not return the table", dc.getTable(quote(SCHEMA), null, quote("cat.master")));
+
+ assertEquals("Foreign key 'masterref' was filtered!", 1, dc.getOneToManyCandidates().size());
+ }
+
+ /*public void testQuatedNamesAndDefaultDatabaseCollector2() {
+ Settings buildSettings = cfg.buildSettings();
+
+ MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( buildSettings.getDialect(), cfg.getProperties() );
+
+ JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), realMetaData );
+
+ DatabaseCollector dc = new DefaultDatabaseCollector();
+ reader.readDatabaseSchema( dc, null, SCHEMA );
+
+ assertNotNull("The table should be found", dc.getTable(quote(SCHEMA), null, quote("cat.child")));
+ assertNotNull("The table should be found", dc.getTable(quote(SCHEMA), null, quote("cat.master")));
+ assertNull("Quoted names should return the table", dc.getTable(SCHEMA, null, "cat.child"));
+ assertNull("Quoted names should return the table", dc.getTable(SCHEMA, null, "cat.master"));
+
+ assertEquals("Foreign key 'masterref' was filtered!", 1, dc.getOneToManyCandidates().size());
+ }*/
+
+ private String quote(String name) {
+ return "`" + name + "`";
+
+ }
+
+ private List getTables(JDBCMetaDataConfiguration metaDataConfiguration) {
+ List list = new ArrayList();
+ Iterator iter = metaDataConfiguration.getTableMappings();
+ while(iter.hasNext()) {
+ Table element = (Table) iter.next();
+ list.add(element);
+ }
+ return list;
+ }
+
+ protected void tearDown() throws Exception {
+ executeDDL(getDropSQL(), false);
+ }
+
+ protected String[] getCreateSQL() {
+ return new String[] {
+ "create schema " + QSCHEMA,
+ "create table " + QSCHEMA + ".\"cat.master\" (" +
+ " id integer NOT NULL," +
+ " tt integer," +
+ " CONSTRAINT master_pk PRIMARY KEY (id)" +
+ ")",
+ "create table " + QSCHEMA + ".\"cat.child\" (" +
+ " childid integer NOT NULL,\r\n" +
+ " masterref integer,\r\n" +
+ " CONSTRAINT child_pk PRIMARY KEY (childid),\r\n" +
+ " CONSTRAINT masterref FOREIGN KEY (masterref) references "+ QSCHEMA + ".\"cat.master\"(id)" +
+ ")",
+ };
+ }
+
+ protected String[] getDropSQL() {
+
+ return new String[] {
+ "drop table " + QSCHEMA + ".\"cat.child\"",
+ "drop table " + QSCHEMA + ".\"cat.master\"",
+ "drop schema " + QSCHEMA
+ };
+ }
+
+ public boolean appliesTo(Dialect dialect) {
+ return dialect instanceof PostgreSQLDialect;
+ }
+
+}
Modified: tools/trunk/src/test/org/hibernate/tool/hbm2x/IncrementalSchemaReadingTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/hbm2x/IncrementalSchemaReadingTest.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/test/org/hibernate/tool/hbm2x/IncrementalSchemaReadingTest.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -51,7 +51,7 @@
tss.addSchemaSelection( new SchemaSelection(null,null, "CHILD") );
- DatabaseCollector dc = new DefaultDatabaseCollector();
+ DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
reader.readDatabaseSchema( dc, null, null );
assertEquals(mockedMetaDataDialect.gottenTables.size(),1);
Modified: tools/trunk/src/test/org/hibernate/tool/test/DriverMetaDataTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/test/DriverMetaDataTest.java 2011-01-11 09:59:12 UTC (rev 20876)
+++ tools/trunk/src/test/org/hibernate/tool/test/DriverMetaDataTest.java 2011-01-18 12:15:04 UTC (rev 20877)
@@ -41,7 +41,7 @@
Settings settings = cfg.buildSettings();
- dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector()));
+ dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector(dialect)));
Iterator tables = dialect.getTables( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), identifier("tab_master") );
@@ -76,7 +76,7 @@
Settings settings = cfg.buildSettings();
- dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector()));
+ dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector(dialect)));
Iterator tables = dialect.getColumns( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), "test", null );
@@ -96,7 +96,7 @@
Settings settings = cfg.buildSettings();
- dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector()));
+ dialect.configure( ReverseEngineeringRuntimeInfo.createInstance(settings.getConnectionProvider(), settings.getSQLExceptionConverter(), new DefaultDatabaseCollector(dialect)));
Iterator tables = dialect.getTables( settings.getDefaultCatalogName(), settings.getDefaultSchemaName(), identifier( "TAB_MASTER"));