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