Package org.jumpmind.symmetric.io
Class DbCompare
java.lang.Object
org.jumpmind.symmetric.io.DbCompare
DbCompare has the ability to compare two SQL-based datasources and output a report of of differences, and optionally SQL to bring the target into sync with
the source.
-
Constructor Summary
ConstructorsConstructorDescriptionDbCompare
(ISymmetricEngine sourceEngine, ISymmetricEngine targetEngine, DbCompareConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
buildOrderBy
(Table table, Column[] sortByColumns, IDatabasePlatform platform, boolean isSource) protected Table
cloneTable
(Table table) compare()
protected int
comparePk
(DbCompareTables tables, DbCompareRow sourceCompareRow, DbCompareRow targetCompareRow) protected boolean
compareTableNames
(String sourceTableName, String targetTableName) protected DbCompareReport.TableReport
compareTables
(DbCompareTables tables, OutputStream sqlDiffOutput) filterTables
(List<String> tables) protected String
getComparisonSQL
(Table table, Column[] sortByColumns, IDatabasePlatform platform, String whereClause, boolean isSource) protected String
getSourceComparisonSQL
(DbCompareTables tables, IDatabasePlatform platform) protected OutputStream
protected OutputStream
protected List<DbCompareTables>
protected String
getTargetComparisonSQL
(DbCompareTables tables, IDatabasePlatform platform) getTransformFor
(Table sourceTable) protected TriggerRouter
getTriggerRouterFor
(Table sourceTable) boolean
protected List<DbCompareTables>
loadTables
(List<String> tableNames, List<String> targetTableNames) protected List<DbCompareTables>
protected List<DbCompareTables>
protected Table
loadTargetTable
(DbCompareTables tables, String targetTableName) protected Table
protected boolean
mapPrimaryKey
(DbCompareTables tables) protected void
-
Constructor Details
-
DbCompare
public DbCompare(ISymmetricEngine sourceEngine, ISymmetricEngine targetEngine, DbCompareConfig config)
-
-
Method Details
-
compare
-
getSqlDiffOutputStream
-
getSqlDiffOutputStream
-
compareTables
protected DbCompareReport.TableReport compareTables(DbCompareTables tables, OutputStream sqlDiffOutput) -
modifyRowForUnitypes
-
comparePk
protected int comparePk(DbCompareTables tables, DbCompareRow sourceCompareRow, DbCompareRow targetCompareRow) -
getSourceComparisonSQL
-
getTargetComparisonSQL
-
getComparisonSQL
protected String getComparisonSQL(Table table, Column[] sortByColumns, IDatabasePlatform platform, String whereClause, boolean isSource) -
buildOrderBy
protected String buildOrderBy(Table table, Column[] sortByColumns, IDatabasePlatform platform, boolean isSource) -
getTablesToCompare
-
loadTablesFromConfig
-
loadTables
-
mapPrimaryKey
-
loadTargetTable
-
getTriggerRouterFor
-
getTransformFor
-
loadTargetTableUsingTransform
protected Table loadTargetTableUsingTransform(TransformService.TransformTableNodeGroupLink transform) -
cloneTable
-
loadTablesFromArguments
-
filterTables
-
compareTableNames
-
isUniType
-
getConfig
-