01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/field/db/queries/TKDBFormTablesDelete.java,v 1.6 2001/10/15 09:59:51 markus Exp $
03: *
04: */
05: /**
06: * Jedes Selectstatement erhaelt eine eigene Klasse
07: */package com.teamkonzept.field.db.queries;
08:
09: import java.sql.*;
10:
11: import com.teamkonzept.db.*;
12: import com.teamkonzept.webman.mainint.db.queries.field.*;
13: import com.teamkonzept.webman.mainint.WebmanExceptionHandler;
14:
15: /**
16: * @author
17: * @version
18: */
19: public class TKDBFormTablesDelete extends TKExtendedPrepQuery {
20:
21: public final static boolean ISPREPARED = true;
22:
23: public final static String[] PARAMORDER = { "FORM_ID", "FORM_ID",
24: "FORM_ID" };
25:
26: public final static Object[][] PARAMTYPESLOCAL = null;
27:
28: public final static boolean[] SETRELEVANTS = { false, false, false };
29:
30: protected static Class[] queryClasses = {
31: DeleteFieldAttribute.class, DeleteSubField.class,
32: DeleteField.class };
33:
34: public boolean execute() {
35: try {
36: init(queryClasses); // init query objects
37: boolean isNotOpen = aTKDBConnection.isAutoCommit();
38: if (isNotOpen) {
39: TKDBManager.beginTransaction();
40: }
41:
42: Object formId = queryParams.get("FORM_ID");
43:
44: queries[0].setQueryParams("FORM_ID", formId);
45: queries[0].execute(); // execute first query
46:
47: queries[1].setQueryParams("FORM_ID", formId);
48: queries[1].execute();
49:
50: queries[2].setQueryParams("FORM_ID", formId);
51: queries[2].execute();
52:
53: if (isNotOpen) {
54: aTKDBConnection.commitTransaction();
55: }
56: } catch (Throwable t) {
57: TKDBManager.safeRollbackTransaction(t);
58: }
59: return hasResults();
60: }
61:
62: public void initQuery(Connection con) {
63: super.initQuery(con, ISPREPARED, PARAMORDER, PARAMTYPESLOCAL,
64: SETRELEVANTS, null);
65: }
66: }
|