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