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 37 public abstract class DatabaseOperation 38 { 39 public static final DatabaseOperation NONE = new DummyOperation(); 40 public static final DatabaseOperation UPDATE = new UpdateOperation(); 41 public static final DatabaseOperation INSERT = new InsertOperation(); 42 public static final DatabaseOperation REFRESH = new RefreshOperation(); 43 public static final DatabaseOperation DELETE = new DeleteOperation(); 44 public static final DatabaseOperation DELETE_ALL = new DeleteAllOperation(); 45 public static final DatabaseOperation TRUNCATE_TABLE = new TruncateTableOperation(); 46 public static final DatabaseOperation CLEAN_INSERT = new CompositeOperation( 47 DELETE_ALL, INSERT); 48 49 56 public abstract void execute(IDatabaseConnection connection, 57 IDataSet dataSet) throws DatabaseUnitException, SQLException ; 58 59 private static class DummyOperation extends DatabaseOperation 60 { 61 public void execute(IDatabaseConnection connection, IDataSet dataSet) 62 { 63 } 64 } 65 } 66 67 68 69 70 71 72 | Popular Tags |