예제 #1
0
 @Override
 public void saveRollbackStatement(Change change, List<SqlVisitor> sqlVisitors, Writer writer)
     throws IOException, UnsupportedChangeException, RollbackImpossibleException,
         StatementNotSupportedOnDatabaseException, LiquibaseException {
   SqlStatement[] statements = change.generateRollbackStatements(this);
   for (SqlStatement statement : statements) {
     for (Sql sql : SqlGeneratorFactory.getInstance().generateSql(statement, this)) {
       writer.append(sql.toSql()).append(sql.getEndDelimiter()).append("\n\n");
     }
   }
 }
예제 #2
0
 @Override
 public void executeRollbackStatements(Change change, List<SqlVisitor> sqlVisitors)
     throws LiquibaseException, UnsupportedChangeException, RollbackImpossibleException {
   SqlStatement[] statements = change.generateRollbackStatements(this);
   List<SqlVisitor> rollbackVisitors = new ArrayList<SqlVisitor>();
   if (sqlVisitors != null) {
     for (SqlVisitor visitor : sqlVisitors) {
       if (visitor.isApplyToRollback()) {
         rollbackVisitors.add(visitor);
       }
     }
   }
   execute(statements, rollbackVisitors);
 }
예제 #3
0
 @Override
 public void executeRollbackStatements(final Change change, final List<SqlVisitor> sqlVisitors)
     throws LiquibaseException, RollbackImpossibleException {
   final SqlStatement[] statements = change.generateRollbackStatements(this);
   executeRollbackStatements(statements, sqlVisitors);
 }