use of org.jumpmind.db.platform.AbstractJdbcDatabasePlatform in project symmetric-ds by JumpMind.
the class TestSetupUtil method dropDatabaseTables.
public static IDatabasePlatform dropDatabaseTables(String databaseType, ISymmetricEngine engine) {
ISymmetricDialect dialect = engine.getSymmetricDialect();
AbstractJdbcDatabasePlatform platform = (AbstractJdbcDatabasePlatform) dialect.getPlatform();
engine.uninstall();
platform.resetDataSource();
IDdlBuilder builder = platform.getDdlBuilder();
Database db2drop = platform.readDatabase(platform.getDefaultCatalog(), platform.getDefaultSchema(), new String[] { "TABLE" });
platform.resetDataSource();
String sql = builder.dropTables(db2drop);
SqlScript dropScript = new SqlScript(sql, platform.getSqlTemplate(), false, platform.getSqlScriptReplacementTokens());
dropScript.execute(true);
platform.resetDataSource();
dialect.cleanDatabase();
platform.resetCachedTableModel();
return platform;
}
Aggregations