01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/webman/mainint/db/queries/sitetree/Attic/DrUpdateRelRefs.java,v 1.2 2000/12/13 11:29:31 marwan Exp $
03: *
04: */
05: package com.teamkonzept.webman.mainint.db.queries.sitetree;
06:
07: import java.sql.*;
08:
09: import com.teamkonzept.db.*;
10:
11: public class DrUpdateRelRefs extends TKPrepQuery {
12:
13: public final static boolean isPrepared = true;
14:
15: public final static String[] paramOrder = { NODE_ID,
16: SITE_NODE_DOC_IDX, NEW_ID, NEW_IDX };
17:
18: public final static Object[][] paramTypes = null;
19:
20: public final static boolean[] setRelevants = null;
21:
22: public final static String sqlString =
23:
24: /* updates references that belong to a certain site_document */
25: " DECLARE "
26: + " new_id INTEGER; "
27: + " new_idx INTEGER; "
28: + " old_id INTEGER; "
29: + " old_idx INTEGER; "
30: + " BEGIN "
31: + " old_id := ?; " /* ?OLD_ID */
32: + " old_idx := ?; " /* ?OLD_IDX */
33: + " new_id := ?; " /* ?NEW_ID */
34: + " new_idx := ?; " /* ?NEW_IDX */
35:
36: + " UPDATE DOCUMENT_REFERENCE "
37: + " SET DEST_SITE_NODE_ID = adjust_relative_refs(old_id, old_idx, SRC_PRESENTATION_COMPONENT_IDX, new_id, new_idx) "
38: + " WHERE " + " SRC_SITE_NODE_ID = new_id " + " AND "
39: + " SRC_SITE_NODE_DOC_IDX = new_idx; " + " END; ";
40:
41: public void initQuery(Connection con) {
42: super.initQuery(con, isPrepared, paramOrder, paramTypes,
43: setRelevants, sqlString);
44: }
45: }
|