KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > generator > db > queries > GenContNodeConts_Part_2


1 package de.webman.generator.db.queries;
2
3 import com.teamkonzept.db.*;
4 import java.sql.*;
5
6 /**
7  * renders the second resultset of the query DBGenContNodeConts
8  *
9  * @see DBGenContNodeConts
10  * @author $Author: markus $
11  * @version $Revision: 1.7 $
12  */

13 public class GenContNodeConts_Part_2 extends TKPrepQuery {
14
15     public static boolean isPrepared =
16         true;
17
18     public static String JavaDoc[] paramOrder =
19         null;
20
21     public static Object JavaDoc[][] paramTypes =
22         null;
23
24     public static boolean[] setRelevants =
25         { true };
26
27     public static String JavaDoc sqlString =
28
29
30
31   " SELECT * FROM ( "
32  + " SELECT CV.VERSION_ID, CV.INSTANCE_ID, CV.CONTENT_ID, CV.STATUS_ID, CV.VERSION_DATE, CV.INFO, CV.AUTHOR, CI.NAME, "
33  + " CT.CONTENT_FORM, CT.CONTENT_NODE_ID, T.CONTENT_NODE_TYPE AS PARENT_TYPE, CT.CONTENT_NODE_NAME, "
34  + " CT.CONTENT_NODE_SHORTNAME, CT.CONTENT_NODE_PARENT, T.CONTENT_NODE_ID AS REF_NODE_ID "
35  + " FROM CONTENT_TREE CT, CONTENT_INSTANCE CI, "
36  + " ( "
37  + " SELECT DISTINCT "
38  + " CT.CONTENT_NODE_ID, "
39  + " CT.CONTENT_NODE_SHORTNAME, "
40  + " CT.CONTENT_NODE_NAME, "
41  + " CT.CONTENT_NODE_TYPE, "
42  + " CT.CONTENT_FORM "
43  + " FROM "
44  + " CONTENT_TREE CT, DOCUMENT_CONTENT DC, SITE_TREE ST "
45  + " WHERE "
46  + " CT.CONTENT_NODE_ID = DC.CONTENT_NODE_ID "
47  + " OR "
48  + " CT.CONTENT_NODE_ID = ST.PG_CONTENT_NODE "
49  + " ) T, "
50  + " CONTENT_VERSION CV "
51  + " WHERE "
52  + " ( CT.CONTENT_NODE_PARENT = T.CONTENT_NODE_ID OR "
53  + " CT.CONTENT_NODE_ID = T.CONTENT_NODE_ID "
54  + " ) AND "
55  + " CT.CONTENT_NODE_ID = CI.CONTENT_NODE_ID AND "
56  + " CI.INSTANCE_ID = CV.INSTANCE_ID "
57  + " AND CV.CONTENT_ID " + DBStringFactory.notEqualsNull()
58  + " UNION "
59 + " SELECT CV.VERSION_ID, CV.INSTANCE_ID, -1, CV.STATUS_ID, CV.VERSION_DATE, CV.INFO, CV.AUTHOR, CI.NAME,"
60  + " CT.CONTENT_FORM, CT.CONTENT_NODE_ID, T.CONTENT_NODE_TYPE AS PARENT_TYPE, CT.CONTENT_NODE_NAME, "
61  + " CT.CONTENT_NODE_SHORTNAME, CT.CONTENT_NODE_PARENT, T.CONTENT_NODE_ID AS REF_NODE_ID "
62  + " FROM CONTENT_TREE CT, CONTENT_INSTANCE CI, "
63  + " ( "
64  + " SELECT DISTINCT "
65  + " CT.CONTENT_NODE_ID, "
66  + " CT.CONTENT_NODE_SHORTNAME, "
67  + " CT.CONTENT_NODE_NAME, "
68  + " CT.CONTENT_NODE_TYPE, "
69  + " CT.CONTENT_FORM "
70  + " FROM "
71  + " CONTENT_TREE CT, DOCUMENT_CONTENT DC, SITE_TREE ST "
72  + " WHERE "
73  + " CT.CONTENT_NODE_ID = DC.CONTENT_NODE_ID "
74  + " OR "
75  + " CT.CONTENT_NODE_ID = ST.PG_CONTENT_NODE "
76  + " ) "
77  + " T, "
78  + " CONTENT_VERSION CV "
79  + " WHERE "
80  + " ( CT.CONTENT_NODE_PARENT = T.CONTENT_NODE_ID OR "
81  + " CT.CONTENT_NODE_ID = T.CONTENT_NODE_ID "
82  + " ) AND "
83  + " CT.CONTENT_NODE_ID = CI.CONTENT_NODE_ID AND "
84  + " CI.INSTANCE_ID = CV.INSTANCE_ID "
85  + " AND CV.CONTENT_ID " + DBStringFactory.equalsNull()
86  + " ) X "
87  + " ORDER BY X.CONTENT_NODE_ID, X.INSTANCE_ID, X.CONTENT_ID, X.VERSION_ID "
88 ;
89
90     public void initQuery(Connection con) {
91         super.initQuery(
92             con,
93             isPrepared,
94             paramOrder,
95             paramTypes,
96             setRelevants,
97             sqlString );
98     }
99 }
100
Popular Tags