1 5 package com.teamkonzept.webman.mainint.db.queries; 6 7 import java.sql.*; 8 9 import com.teamkonzept.db.*; 10 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 11 import com.teamkonzept.webman.mainint.db.queries.presentation.*; 12 13 26 public class TKDBPresCompDelete extends TKExtendedPrepQuery 27 { 28 29 public final static boolean ISPREPARED = true; 30 31 public final static String [] ORDER = 32 { "PRESENTATION_ID", "PRESENTATION_COMPONENT_IDX" }; 33 34 public final static Object [][] TYPES = null; 35 36 public final static boolean[] SETRELEVANTS = { false }; 37 38 protected static Class [] queryClasses = { 39 DeleteFromPresentationContent.class, DeleteFromPresentationReference.class, DeleteFromPresentationComponent.class, DeleteFromDocumentReference.class, DeleteFromDocumentContent.class }; 45 46 public boolean execute() 47 { 48 try 49 { 50 init(queryClasses); 51 52 Integer presId = (Integer ) queryParams.get("PRESENTATION_ID"); 53 Integer presCompIdx = 54 (Integer ) queryParams.get("PRESENTATION_COMPONENT_IDX"); 55 56 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 57 if (isNotOpen) 58 { 59 TKDBManager.beginTransaction(); 60 } 61 62 queries[0].setQueryParams("PRESENTATION_ID", presId); 65 queries[0].setQueryParams("PRESENTATION_COMPONENT_IDX", presCompIdx); 66 queries[0].execute(); 67 68 queries[1].setQueryParams("PRESENTATION_ID", presId); 71 queries[1].setQueryParams("PRESENTATION_COMPONENT_IDX", presCompIdx); 72 queries[1].execute(); 73 74 queries[2].setQueryParams("PRESENTATION_ID", presId); 77 queries[2].setQueryParams("PRESENTATION_COMPONENT_IDX", presCompIdx); 78 queries[2].execute(); 79 80 queries[3].setQueryParams("PRESENTATION_ID", presId); 91 queries[3].setQueryParams("PRESENTATION_COMPONENT_IDX", presCompIdx); 92 queries[3].execute(); 93 94 queries[4].setQueryParams("PRESENTATION_ID", presId); 104 queries[4].setQueryParams("PRESENTATION_COMPONENT_IDX", presCompIdx); 105 queries[4].execute(); 106 107 if (isNotOpen) 108 { 109 TKDBManager.commitTransaction(); 110 } 111 112 } 113 catch(Throwable t) 114 { 115 TKDBManager.safeRollbackTransaction(t); 116 } 117 return hasResults(); 118 } 119 120 public void initQuery(Connection con) 121 { 122 super.initQuery(con, ISPREPARED, ORDER, TYPES, SETRELEVANTS, null); 123 } 124 } 125 | Popular Tags |