Skip to content

Commit

Permalink
tested oracle platform
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed May 23, 2011
1 parent ae7e7f1 commit 5e16bd3
Show file tree
Hide file tree
Showing 21 changed files with 476 additions and 168 deletions.
9 changes: 7 additions & 2 deletions future/symmetric3-core/pom.xml
Expand Up @@ -5,7 +5,7 @@
<artifactId>symmetric3-core</artifactId>
<packaging>jar</packaging>
<version>3.0.0-SNAPSHOT</version>
<name>core</name>
<name>symmetric3-core</name>

<parent>
<groupId>org.jumpmind.symmetric</groupId>
Expand All @@ -23,7 +23,12 @@
<groupId>xpp3</groupId>
<artifactId>xpp3_min</artifactId>
<version>1.1.4c</version>
</dependency>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
@@ -1,7 +1,7 @@
package org.jumpmind.symmetric.core.common;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

public class DefaultLog extends Log {

Expand Down Expand Up @@ -33,32 +33,32 @@ public void debug(String msg) {

@Override
public boolean isDebugEnabled() {
return logger.isLoggable(Level.FINE);
return logger.isDebugEnabled();
}

public void log(LogLevel level, Throwable error, String msg, Object... params) {
Level loggerLevel = Level.SEVERE;
Level loggerLevel = Level.FATAL;

switch (level) {
case DEBUG:
loggerLevel = Level.FINE;
loggerLevel = Level.DEBUG;
break;
case INFO:
loggerLevel = Level.INFO;
break;
case WARN:
loggerLevel = Level.WARNING;
loggerLevel = Level.WARN;
break;
}

if (logger.isLoggable(loggerLevel)) {
if (logger.isEnabledFor(loggerLevel)) {
if (error != null && params == null) {
logger.log(loggerLevel, msg, error);
} else if (error != null && msg != null && params != null) {
logger.log(loggerLevel, msg, params);
logger.log(loggerLevel, String.format(msg, params));
logger.log(loggerLevel, error.getMessage(), error);
} else if (msg != null) {
logger.log(loggerLevel, msg, params);
logger.log(loggerLevel, String.format(msg, params));
}
}

Expand Down
Expand Up @@ -964,7 +964,7 @@ protected Table getTemporaryTableFor(Database targetModel, Table targetTable) {

table.setCatalogName(targetTable.getCatalogName());
table.setSchemaName(targetTable.getSchemaName());
table.setTableName(targetTable.getTableName() + "");
table.setTableName(targetTable.getTableName() + "_");
table.setType(targetTable.getType());
for (int idx = 0; idx < targetTable.getColumnCount(); idx++) {
try {
Expand Down Expand Up @@ -1625,7 +1625,7 @@ public String shortenName(String name, int desiredLength) {
// right
// after the cutting place (which would look odd with an aditional
// one)
result.append("");
result.append("_");
}
result.append(name.substring(startCut + delta + 1, originalLength));
return result.toString();
Expand Down Expand Up @@ -2058,7 +2058,7 @@ public String getForeignKeyName(Table table, ForeignKey fk) {

for (int idx = 0; idx < fk.getReferenceCount(); idx++) {
name.append(fk.getReference(idx).getLocalColumnName());
name.append("");
name.append("_");
}
name.append(fk.getForeignTableName());
fkName = getConstraintName(null, table, "FK", name.toString());
Expand Down Expand Up @@ -2095,13 +2095,13 @@ public String getConstraintName(String prefix, Table table, String secondPart, S

if (prefix != null) {
result.append(prefix);
result.append("");
result.append("_");
}
result.append(table.getTableName());
result.append("");
result.append("_");
result.append(secondPart);
if (suffix != null) {
result.append("");
result.append("_");
result.append(suffix);
}
return shortenName(result.toString(), getMaxConstraintNameLength());
Expand Down
Expand Up @@ -80,8 +80,6 @@ public TriggerBuilder(IDbPlatform dbPlatform) {

abstract protected String getDataHasChangedCondition();

abstract protected String getSourceNodeExpression();

abstract protected String getSyncTriggersExpression();

protected String getInitialLoadTableAlias() {
Expand Down Expand Up @@ -382,7 +380,6 @@ protected String replaceTemplateVariables(DataEventType dml, TriggerHistory hist
preProcessTriggerSqlClause(trigger.getSyncOnDeleteCondition()), ddl);
ddl = StringUtils.replaceTokens("dataHasChangedCondition",
preProcessTriggerSqlClause(getDataHasChangedCondition()), ddl);
ddl = StringUtils.replaceTokens("sourceNodeExpression", getSourceNodeExpression(), ddl);

String defaultCatalog = dbPlatform.getDefaultCatalog();
String defaultSchema = dbPlatform.getDefaultSchema();
Expand Down
Expand Up @@ -42,6 +42,7 @@
* TODO: Add support and tests for the change of the column order
*/
public class ModelComparator {

/** The log for this comparator. */
private final Log log = LogFactory.getLog(ModelComparator.class);

Expand Down
Expand Up @@ -192,11 +192,6 @@ protected String getDataHasChangedCondition() {
return SqlConstants.ALWAYS_TRUE_CONDITION;
}

@Override
protected String getSourceNodeExpression() {
return null;
}

@Override
protected String getSyncTriggersExpression() {
return " @sync_prevented is null ";
Expand Down

0 comments on commit 5e16bd3

Please sign in to comment.