1 21 22 package org.dbunit.operation; 23 24 import org.dbunit.DatabaseUnitException; 25 import org.dbunit.database.IDatabaseConnection; 26 import org.dbunit.dataset.IDataSet; 27 28 import java.sql.SQLException ; 29 30 38 public class CompositeOperation extends DatabaseOperation 39 { 40 private final DatabaseOperation[] _actions; 41 42 45 public CompositeOperation(DatabaseOperation action1, DatabaseOperation action2) 46 { 47 _actions = new DatabaseOperation[]{action1, action2}; 48 } 49 50 53 public CompositeOperation(DatabaseOperation[] actions) 54 { 55 _actions = actions; 56 } 57 58 61 public void execute(IDatabaseConnection connection, IDataSet dataSet) 62 throws DatabaseUnitException, SQLException 63 { 64 for (int i = 0; i < _actions.length; i++) 65 { 66 DatabaseOperation action = _actions[i]; 67 action.execute(connection, dataSet); 68 } 69 } 70 } 71 72 73 74 75 76 | Popular Tags |