Skip to content

Commit

Permalink
sometimes sql task should not do replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jan 3, 2008
1 parent e243bd8 commit 62398c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Expand Up @@ -39,6 +39,8 @@ public class SqlUpgradeTask implements IUpgradeTask {
protected boolean isUpgradeRegistrationServer = true;

protected boolean isUpgradeNonRegistrationServer = true;

protected boolean useReplacement = true;

public void upgrade(int[] fromVersion) {
for (String sql : sqlList) {
Expand All @@ -49,10 +51,12 @@ public void upgrade(int[] fromVersion) {

public void upgrade(Node node, int[] fromVersion) {
for (String sql : sqlList) {
if (useReplacement) {
sql = replace("groupId", node.getNodeGroupId(), sql);
sql = replace("externalId", node.getExternalId(), sql);
sql = replace("nodeId", node.getNodeId(), sql);
}
logger.debug("upgrade->" + sql);
sql = replace("groupId", node.getNodeGroupId(), sql);
sql = replace("externalId", node.getExternalId(), sql);
sql = replace("nodeId", node.getNodeId(), sql);
jdbcTemplate.update(sql);
}
}
Expand Down Expand Up @@ -93,4 +97,12 @@ public void setUpgradeRegistrationServer(boolean isUpgradeRegistrationServer) {
this.isUpgradeRegistrationServer = isUpgradeRegistrationServer;
}

public boolean getUseReplacement() {
return useReplacement;
}

public void setUseReplacement(boolean useReplacement) {
this.useReplacement = useReplacement;
}

}
1 change: 1 addition & 0 deletions symmetric/src/main/resources/symmetric-upgrade.xml
Expand Up @@ -62,6 +62,7 @@
<!-- Changes made in version 1.2 -->
<bean id="changes1.2" class="org.jumpmind.symmetric.upgrade.SqlUpgradeTask">
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="useReplacement" value="false" />
<property name="sqlList">
<list>
<value>
Expand Down

0 comments on commit 62398c3

Please sign in to comment.