Hibernate SVN: r20879 - in tools/trunk/src: test/org/hibernate/tool/hbm2x and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-01-21 11:07:05 -0500 (Fri, 21 Jan 2011)
New Revision: 20879
Modified:
tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java
tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8189
Removed wrong parameters swap
Modified: tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java
===================================================================
--- tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java 2011-01-18 13:01:02 UTC (rev 20878)
+++ tools/trunk/src/java/org/hibernate/cfg/reveng/MappingsDatabaseCollector.java 2011-01-21 16:07:05 UTC (rev 20879)
@@ -20,11 +20,11 @@
}
public Table addTable(String schema, String catalog, String name) {
- return mappings.addTable(quote(catalog), quote(schema), quote(name), null, false);
+ return mappings.addTable(quote(schema), quote(catalog), quote(name), null, false);
}
public Table getTable(String schema, String catalog, String name) {
- return mappings.getTable(quote(catalog), quote(schema), quote(name));
+ return mappings.getTable(quote(schema), quote(catalog), quote(name));
}
}
Modified: tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java
===================================================================
--- tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java 2011-01-18 13:01:02 UTC (rev 20878)
+++ tools/trunk/src/test/org/hibernate/tool/hbm2x/DefaultDatabaseCollectorTest.java 2011-01-21 16:07:05 UTC (rev 20879)
@@ -56,9 +56,6 @@
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);
@@ -88,7 +85,7 @@
* 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() {
+ public void testQuotedNamesAndDefaultDatabaseCollector() {
Settings buildSettings = cfg.buildSettings();
MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( buildSettings.getDialect(), cfg.getProperties() );
@@ -106,27 +103,8 @@
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) {