1 5 8 package com.teamkonzept.field.db.queries; 9 10 import java.sql.*; 11 12 import com.teamkonzept.db.*; 13 import com.teamkonzept.webman.mainint.db.queries.field.*; 14 import com.teamkonzept.webman.mainint.WebmanExceptionHandler; 15 16 20 public class TKDBFormDelete extends TKExtendedPrepQuery 21 { 22 23 public final static boolean ISPREPARED = true; 24 25 public final static String [] PARAMORDER = { "FORM_ID", "FORM_ID" }; 26 27 public final static Object [][] PARAMTYPESLOCAL = null; 28 29 public final static boolean[] SETRELEVANTS = { false }; 30 31 protected static Class [] queryClasses = 32 { DeleteStructuredContent.class, DeleteForm.class }; 33 34 35 public boolean execute() 36 { 37 try 38 { 39 init(queryClasses); 41 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 42 if (isNotOpen) 43 { 44 TKDBManager.beginTransaction(); 45 } 46 47 Object formId = queryParams.get("FORM_ID"); 48 49 queries[0].setQueryParams("FORM_ID", formId); 50 queries[0].execute(); 52 queries[1].setQueryParams("FORM_ID", formId); 53 queries[1].execute(); 55 if (isNotOpen) 56 { 57 aTKDBConnection.commitTransaction(); 58 } 59 60 } 61 catch(Throwable t) 62 { 63 TKDBManager.safeRollbackTransaction(t); 64 } 65 return hasResults(); 66 } 67 68 public void initQuery(Connection con) 69 { 70 super.initQuery(con, 71 ISPREPARED, 72 PARAMORDER, PARAMTYPESLOCAL, SETRELEVANTS, null); 73 } 74 } 75 | Popular Tags |