Ejemplo n.º 1
0
  /**
   * Takes a list of SqlVisitors and returns a new list with only the SqlVisitors set to apply to
   * rollbacks
   */
  protected List<SqlVisitor> filterRollbackVisitors(final List<SqlVisitor> visitors) {
    final List<SqlVisitor> rollbackVisitors = new ArrayList<SqlVisitor>();
    if (visitors != null) {
      for (SqlVisitor visitor : visitors) {
        if (visitor.isApplyToRollback()) {
          rollbackVisitors.add(visitor);
        }
      }
    }

    return rollbackVisitors;
  }
Ejemplo 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);
 }