KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > form > db > queries > SelectReferencedSiteNodes


1 package de.webman.form.db.queries;
2
3 import java.sql.Connection JavaDoc;
4 import com.teamkonzept.db.TKPrepQuery;
5 import de.webman.form.db.FormConstants;
6
7 /**
8  * Selects all document type components referenced by the specified form definition.
9  * <TABLE>
10  * <TR>
11  * <TD><B>Order</B></TD>
12  * <TD><B>Name</B></TD>
13  * <TD><B>Type</B></TD>
14  * </TR>
15  * <TR>
16  * <TD COLSPAN="3"><I>Parameters</I></TD>
17  * </TR>
18  * <TR>
19  * <TD><TT>1</TT></TD>
20  * <TD><TT>de.webman.form.db.FormConstants.FORM_ID</TT></TD>
21  * <TD><TT>java.lang.Integer</TT></TD>
22  * </TR>
23  * <TR>
24  * <TD COLSPAN="3"><I>Results</I></TD>
25  * </TR>
26  * <TR>
27  * <TD><TT>1</TT></TD>
28  * <TD><TT>SITE_TREE.SITE_NODE_ID</TT></TD>
29  * <TD><TT>java.lang.String</TT></TD>
30  * </TR>
31  * <TR>
32  * <TD><TT>2</TT></TD>
33  * <TD><TT>SITE_TREE.SITE_NODE_NAME</TT></TD>
34  * <TD><TT>java.lang.String</TT></TD>
35  * </TR>
36  * </TABLE>
37  *
38  * @author $Author: uli $
39  * @version $Revision: 1.3 $
40  */

41 public class SelectReferencedSiteNodes
42     extends TKPrepQuery
43 {
44
45     // Constants.
46

47     /**
48      * The preparation state.
49      */

50     private final static boolean IS_PREPARED = true;
51
52     /**
53      * The parameter order.
54      */

55     private final static String JavaDoc[] PARAMETER_ORDER =
56     {
57         FormConstants.COLUMN_NAMES[FormConstants.FORM_ID]
58     };
59
60     /**
61      * The parameter types.
62      */

63     private final static Object JavaDoc[][] PARAMETER_TYPES =
64     {
65         {FormConstants.COLUMN_NAMES[FormConstants.FORM_ID], FormConstants.COLUMN_TYPES[FormConstants.FORM_ID]}
66     };
67
68     /**
69      * The relevance state.
70      */

71     private final static boolean[] SET_RELEVANTS =
72     {
73         true
74     };
75
76     /**
77      * The SQL statement.
78      */

79     private final static String JavaDoc SQL_STRING = "SELECT ST.SITE_NODE_ID, ST.SITE_NODE_NAME, ST.SITE_NODE_PARENT " +
80                                              "FROM FORM FO, STRUCTURED_CONTENT SC, SITE_TREE ST " +
81                                              "WHERE FO.FORM_ID = ? " +
82                                              "AND FO.FORM_ID = SC.FORM_ID " +
83                                              "AND SC.SITE_NODE_ID = ST.SITE_NODE_ID";
84
85
86     // Implementation of 'com.teamkonzept.db.TKQuery'
87

88     /**
89      * Initializes the query with the given connection.
90      *
91      * @param connection the connection.
92      */

93     public void initQuery (Connection JavaDoc connection)
94     {
95         super.initQuery(connection,
96                         IS_PREPARED,
97                         PARAMETER_ORDER,
98                         PARAMETER_TYPES,
99                         SET_RELEVANTS,
100                         SQL_STRING);
101     }
102
103 }
104
Popular Tags