1 5 8 package com.teamkonzept.webman.mainint.db.queries.oracle; 9 10 import java.sql.*; 11 12 import com.teamkonzept.db.*; 13 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 14 import com.teamkonzept.webman.mainint.db.queries.presentation.*; 15 16 22 public class TKDBPresDelete extends TKExtendedPrepQuery 23 { 24 25 public final static boolean isPrepared = true; 26 27 public final static String [] order = { "PRESENTATION_ID" }; 28 29 public final static Object [][] types = null; 30 31 public final static boolean[] setRelevants = { false }; 32 33 60 61 protected static Class [] queryClasses = { 62 DeleteFromPresentationReferenceSimple.class, 63 DeleteFromPresentationContentSimple.class, 64 DeleteFromPresentationComponentSimple.class, 65 DeleteFromPresentationSimple.class 66 }; 67 68 public boolean execute() 69 { 70 try 71 { 72 init(queryClasses); 73 74 Integer presId = (Integer ) queryParams.get("PRESENTATION_ID"); 75 76 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 77 if (isNotOpen) 78 { 79 TKDBManager.beginTransaction(); 80 } 81 82 queries[0].setQueryParams("PRESENTATION_ID", presId); 84 queries[0].execute(); 85 86 queries[1].setQueryParams("PRESENTATION_ID", presId); 88 queries[1].execute(); 89 90 queries[2].setQueryParams("PRESENTATION_ID", presId); 92 queries[2].execute(); 93 94 queries[3].setQueryParams("PRESENTATION_ID", presId); 96 queries[3].execute(); 97 98 if (isNotOpen) 99 { 100 TKDBManager.commitTransaction(); 101 } 102 103 } 104 catch(Throwable t) 105 { 106 TKDBManager.safeRollbackTransaction(t); 107 } 108 return hasResults(); 109 } 110 111 public void initQuery(Connection con) 112 { 113 super.initQuery(con, isPrepared, order, types, setRelevants, null); 114 } 115 } 116 | Popular Tags |