1 package de.webman.content.db.queries; 2 3 import de.webman.content.db.queries.DeleteContentAttrValueByValue; 4 import de.webman.content.db.queries.DeleteContentAttrByValue; 5 6 import com.teamkonzept.db.*; 7 import java.sql.*; 8 9 20 public class TKDBContentAttributeDelete extends TKExtendedPrepQuery { 21 22 public final static boolean ISPREPARED = true; 23 public final static String [] PARAMORDER = { "VALUE_ID" }; 24 public final static Object [][] PARAMTYPES = null; 25 public final static boolean[] SETRELEVANTS = { false }; 26 27 protected static Class [] queryClasses = { 28 DeleteContentAttrValueByValue.class, DeleteContentAttrByValue.class, }; 31 32 public boolean execute() 33 { 34 try 35 { 36 37 init(queryClasses); 39 boolean isNotOpen = aTKDBConnection.isAutoCommit(); 41 if (isNotOpen) 42 { 43 TKDBManager.beginTransaction(); } 45 46 queries[0].setQueryParams("VALUE_ID", queryParams.get("VALUE_ID")); 48 queries[0].execute(); 49 queries[1].setQueryParams("VALUE_ID", queryParams.get("VALUE_ID")); 51 queries[1].execute(); 52 53 if (isNotOpen) 55 { 56 aTKDBConnection.commitTransaction(); } 58 59 } 60 catch(Throwable t) 61 { 62 TKDBManager.safeRollbackTransaction(t); 63 } 64 return hasResults(); 65 } 66 67 public void initQuery(Connection con) { 68 super.initQuery( 69 con, 70 ISPREPARED, 71 PARAMORDER, 72 PARAMTYPES, 73 SETRELEVANTS, 74 null ); 75 } 76 } 77 | Popular Tags |