KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > webman > mainint > db > queries > duplication > oracle > DuplicationPackageDeclaration


1 package com.teamkonzept.webman.mainint.db.queries.duplication.oracle;
2
3
4 import com.teamkonzept.db.*;
5 //import com.teamkonzept.lib.*;
6

7 import java.io.*;
8 import java.util.*;
9 import java.sql.*;
10
11
12     /**
13      * Package for procedures for duplication of subtrees in content- and sitetree.
14      * This package depends on the existence of certain temporary tables and sequences
15      * that have to be created separatly.
16          * @author marwan
17      * @version 1.3
18      * @see UtilityProceduresPackageDeclaration
19      * @see DuplicationPackageBody
20      */

21         
22 public class DuplicationPackageDeclaration extends TKPrepQuery{
23
24     public static boolean isPrepared =
25         true;
26     
27     public static String JavaDoc[] paramOrder =
28         null;
29     
30     public static Object JavaDoc[][] paramTypes =
31         null;
32                 
33     public static boolean[] setRelevants =
34         null;
35         
36     public static String JavaDoc sqlString =
37 /* Package for procedures for duplication of subtrees in content- and sitetree. */
38 /* This package depends on the existence of certain temporary tables and sequences */
39 /* that have to be created separatly. */
40  "CREATE OR REPLACE PACKAGE DUPLICATION IS "
41  + " " /* "Main" Procedure, controls the whole duplication process */
42  + " PROCEDURE duplicate_manager( "
43  + " ct_src INTEGER, ct_dest INTEGER, ct_new_name VARCHAR2, ct_new_shortname VARCHAR2, "
44  + " st_src INTEGER, st_dest INTEGER, st_new_name VARCHAR2, st_new_shortname VARCHAR2 "
45  + " ); "
46
47
48  + " " /* Procedure to duplicate CONTENT and referencing tables */
49  + " " /* Depends on existence of a sequence C_SEQUENCE */
50  + " " /* that generates unused IDs for the table CONTENT */
51  + " FUNCTION duplicate_content(con_id INTEGER) RETURN INTEGER; "
52     
53
54  + " " /* Procedure to copy a subtree, rootet at src_id under dest_id. */
55  + " " /* Relies on the existence of a table that translates old ids to new ones. */
56  + " FUNCTION st_copy_subtree(src_id INTEGER, dest_id INTEGER) RETURN INTEGER; "
57     
58  + " " /* Procedure to duplicate CONTENT_INSTANCE and related tables */
59  + " " /* Depends on several temporary tables and sequences */
60  + " PROCEDURE duplicate_content_instances; "
61     
62  + " " /* Duplicates document tables */
63  + " PROCEDURE duplicate_documents; "
64     
65     
66  + " " /* Procedure to make DOCUMENT_CONTENT.CONTENT_NODE_ID point to duplicated content */
67  + " PROCEDURE document_content_adjustref; "
68     
69     
70  + " " /* Returntype for function select_results */
71  + " TYPE cursor_type is ref cursor; "
72     
73  + " " /* Returns new IDs */
74  + " FUNCTION select_results(ct_id INTEGER, st_id INTEGER) RETURN cursor_type; "
75  + " END DUPLICATION; "
76  
77
78  ;
79  
80  
81     public void initQuery(Connection con) {
82         super.initQuery(
83             con,
84             isPrepared,
85             paramOrder,
86             paramTypes,
87             setRelevants,
88             sqlString );
89     }
90 }
91
92
Popular Tags