Skip to content

Commit

Permalink
make sure replacement tokens are used when parsing sql script
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Dec 7, 2011
1 parent 4e15284 commit 3dbdd7e
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -53,8 +53,6 @@ public class SqlScript {

private boolean failOnError = true;

private Map<String, String> replacementTokens;

private String lineDeliminator;

public SqlScript(URL url, ISqlTemplate sqlTemplate) {
Expand Down Expand Up @@ -97,14 +95,13 @@ public SqlScript(String sqlScript, ISqlTemplate sqlTemplate, boolean failOnError

private void init(List<String> sqlScript, ISqlTemplate sqlTemplate, boolean failOnError,
String delimiter, Map<String, String> replacementTokens) {
this.statements = parseLines(sqlScript);
this.statements = parseLines(sqlScript, replacementTokens);
this.sqlTemplate = sqlTemplate;
this.failOnError = failOnError;
this.delimiter = delimiter;
this.replacementTokens = replacementTokens;
}

protected List<String> parseLines(List<String> script) {
protected List<String> parseLines(List<String> script, Map<String, String> replacementTokens) {
List<String> statements = new ArrayList<String>();
StringBuilder sql = new StringBuilder();
for (String line : script) {
Expand Down

0 comments on commit 3dbdd7e

Please sign in to comment.