1 5 package com.teamkonzept.webman.mainint.db.queries.oracle; 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.properties.*; 12 13 19 public class TKDBPropDelete extends TKExtendedPrepQuery 20 { 21 22 public final static boolean IS_PREPARED = true; 23 24 public final static String [] ORDER = { "PROP_ID", "PROP_ID" }; 25 26 public final static Object [][] TYPES = 27 { {"PROP_ID", new Integer (Types.INTEGER)} }; 28 29 public final static boolean[] SET_RELEVANTS = { true }; 30 31 45 46 47 protected static Class [] queryClasses = { 48 DeleteFromPropertyGroupMember.class, 49 DeleteFromProperty.class 50 }; 51 52 public boolean execute() 53 { 54 try 55 { 56 init(queryClasses); 57 58 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 59 if (isNotOpen) 60 { 61 TKDBManager.beginTransaction(); 62 } 63 64 queries[0].setQueryParams("PROPERTY_ID", 66 queryParams.get("PROP_ID")); 67 queries[0].execute(); 68 69 71 queries[1].setQueryParams("PROPERTY_ID", queryParams.get("PROP_ID")); 72 queries[1].execute(); 73 74 if (isNotOpen) 75 { 76 TKDBManager.commitTransaction(); 77 } 78 79 } 80 catch(Throwable t) 81 { 82 TKDBManager.safeRollbackTransaction(t); 83 } 84 return hasResults(); 85 } 86 87 public void initQuery(Connection con) 88 { 89 super.initQuery(con, 90 IS_PREPARED, ORDER, TYPES, SET_RELEVANTS, null); 91 } 92 } 93 | Popular Tags |