1 package de.webman.acl.db.queries; 2 3 import java.sql.Connection ; 4 import java.sql.SQLException ; 5 import java.sql.Types ; 6 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 7 import com.teamkonzept.db.*; 8 import com.teamkonzept.webman.mainint.db.queries.accesscontrol.*; 9 10 17 public class ActionDelete 18 extends TKExtendedPrepQuery 19 { 20 21 23 public static final String [] ORDER = 24 { 25 "WM_ACTION_ID", 26 "WM_ACTION_ID" 27 }; 28 29 public static final Object [][] TYPES = 30 { 31 {"WM_ACTION_ID", new Integer (Types.INTEGER)}, 32 {"WM_ACTION_ID", new Integer (Types.INTEGER)} 33 }; 34 35 public static final boolean[] RELEVANTS = 36 { 37 false 38 }; 39 40 44 protected static Class [] queryClasses = {DeleteWMTaskAction.class, DeleteWMAction.class}; 45 46 47 49 public boolean execute() { 50 try { 51 init(queryClasses); 52 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 53 if (isNotOpen) { 54 aTKDBConnection.beginTransaction(); 55 } 56 57 queries[0].setQueryParams("WM_ACTION_ID", queryParams.get("WM_ACTION_ID")); 58 queries[0].execute(); 59 60 queries[1].setQueryParams("WM_ACTION_ID", queryParams.get("WM_ACTION_ID")); 61 queries[1].execute(); 62 63 if (isNotOpen) { 64 aTKDBConnection.commitTransaction(); 65 } 66 } 67 catch (SQLException sqle) { 68 WebmanExceptionHandler.getException(sqle); 69 try { 70 aTKDBConnection.rollbackTransaction(); 71 } 72 catch (SQLException sqle2) { 73 WebmanExceptionHandler.getException(sqle2); 74 } 75 } 76 finally { 77 return hasResults(); 78 } 79 } 80 81 public void initQuery (Connection connection) 82 { 83 super.initQuery(connection, 84 true, 85 ORDER, 86 TYPES, 87 RELEVANTS, 88 null); 89 } 90 91 } 92 | Popular Tags |