Skip to content

Commit

Permalink
0002564: More generous handling of include and exclude table names.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Apr 22, 2016
1 parent ee0872f commit b28ff99
Showing 1 changed file with 17 additions and 2 deletions.
Expand Up @@ -406,7 +406,7 @@ protected List<String> filterTables(List<String> tables) {
if (!CollectionUtils.isEmpty(includedTableNames)) {
for (String includedTableName : includedTableNames) {
for (String tableName : tables) {
if (StringUtils.equalsIgnoreCase(tableName.trim(), includedTableName.trim())) {
if (compareTableNames(tableName, includedTableName)) {
filteredTables.add(tableName);
}
}
Expand All @@ -420,7 +420,7 @@ protected List<String> filterTables(List<String> tables) {

for (String excludedTableName : excludedTableNames) {
for (String tableName : filteredTables) {
if (StringUtils.equalsIgnoreCase(tableName.trim(), excludedTableName.trim())) {
if (compareTableNames(tableName, excludedTableName)) {
excludedTables.remove(tableName);
}
}
Expand All @@ -430,6 +430,21 @@ protected List<String> filterTables(List<String> tables) {

return filteredTables;
}

protected boolean compareTableNames(String sourceTableName, String targetTableName) {
sourceTableName = sourceTableName.trim();
targetTableName = targetTableName.trim();

if (StringUtils.equalsIgnoreCase(sourceTableName, targetTableName)) {
return true;
} else {
Map<String, String> sourceTableNameParts =
sourceEngine.getDatabasePlatform().parseQualifiedTableName(sourceTableName);
Map<String, String> targetTableNameParts =
targetEngine.getDatabasePlatform().parseQualifiedTableName(targetTableName);
return StringUtils.equalsIgnoreCase(sourceTableNameParts.get("table"), targetTableNameParts.get("table"));
}
}

public List<String> getIncludedTableNames() {
return includedTableNames;
Expand Down

0 comments on commit b28ff99

Please sign in to comment.