KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > content > db > queries > XMLStructuredContentRetrieve


1 package de.webman.content.db.queries;
2
3 import java.sql.Connection JavaDoc;
4 import java.sql.Types JavaDoc;
5 import com.teamkonzept.db.TKPrepQuery;
6 import de.webman.content.db.ContentConstants;
7 import de.webman.content.db.StructuredContentConstants;
8 import de.webman.form.db.FormConstants;
9
10 /**
11  * Retrieves an existing structured content from the database.
12  * <TABLE>
13  * <TR>
14  * <TD><B>Order</B></TD>
15  * <TD><B>Name</B></TD>
16  * <TD><B>Type</B></TD>
17  * </TR>
18  * <TR>
19  * <TD COLSPAN="3"><I>Parameters<I/></TD>
20  * </TR>
21  * <TR>
22  * <TD><TT>1</TT></TD>
23  * <TD><TT>de.webman.content.db.ContentConstants.CONTENT_ID</TT></TD>
24  * <TD><TT>java.lang.Integer</TT></TD>
25  * </TR>
26  * <TR>
27  * <TD COLSPAN="3"><I>Results<I/></TD>
28  * </TR>
29  * <TR>
30  * <TD><TT>1</TT></TD>
31  * <TD><TT>de.webman.content.db.ContentConstants.XML_TEXT</TT></TD>
32  * <TD><TT>java.lang.String</TT></TD>
33  * </TR>
34  * <TR>
35  * <TD><TT>2</TT></TD>
36  * <TD><TT>de.webman.content.db.StructuredContentConstants.FORM_ID</TT></TD>
37  * <TD><TT>java.lang.Integer</TT></TD>
38  * </TR>
39  * <TR>
40  * <TD><TT>3</TT></TD>
41  * <TD><TT>de.webman.form.db.FormConstants.FORM_NAME</TT></TD>
42  * <TD><TT>java.lang.String</TT></TD>
43  * </TR>
44  * <TR>
45  * <TD><TT>4</TT></TD>
46  * <TD><TT>de.webman.form.db.FormConstants.FORM_DESCRIPTION</TT></TD>
47  * <TD><TT>java.lang.String</TT></TD>
48  * </TR>
49  * </TABLE>
50  *
51  * @author <A HREF="mailto:unl@webman.de">Ulrich Nicolas Liss&eacute;</A>,
52  * &copy; 2001 Webman AG.
53  * @version $Revision: 1.1 $
54  */

55 public class XMLStructuredContentRetrieve
56     extends TKPrepQuery
57 {
58     // $Id: XMLStructuredContentRetrieve.java,v 1.1 2001/09/28 14:50:36 uli Exp $
59

60     // Constants.
61

62     /**
63      * The preparation state.
64      */

65     private final static boolean IS_PREPARED = true;
66
67     /**
68      * The parameter order.
69      */

70     private final static String JavaDoc[] PARAMETER_ORDER =
71     {
72         ContentConstants.CONTENT_ID
73     };
74
75     /**
76      * The parameter types.
77      */

78     private final static Object JavaDoc[][] PARAMETER_TYPES =
79     {
80         {ContentConstants.CONTENT_ID, new Integer JavaDoc(Types.INTEGER)}
81     };
82
83     /**
84      * The relevance state.
85      */

86     private final static boolean[] SET_RELEVANTS =
87     {
88         true
89     };
90
91     /**
92      * The SQL statement.
93      */

94     private final static String JavaDoc SQL_STRING = (new StringBuffer JavaDoc()).append("SELECT CONTENT.XML_TEXT, STRUCTURED_CONTENT.FORM_ID, FORM.FORM_NAME, FORM.FORM_DESCRIPTION ")
95                                                                  .append("FROM CONTENT, STRUCTURED_CONTENT, FORM ")
96                                                                  .append("WHERE CONTENT.CONTENT_ID = ? ")
97                                                                  .append("AND CONTENT.CONTENT_ID = STRUCTURED_CONTENT.CONTENT_ID ")
98                                                                  .append("AND STRUCTURED_CONTENT.FORM_ID = FORM.FORM_ID")
99                                                                  .toString();
100
101
102     // Implementation of 'com.teamkonzept.db.TKQuery'
103

104     /**
105      * Initializes the query with the given connection.
106      *
107      * @param connection the connection.
108      */

109     public void initQuery (Connection JavaDoc connection)
110     {
111         super.initQuery(connection,
112                         IS_PREPARED,
113                         PARAMETER_ORDER,
114                         PARAMETER_TYPES,
115                         SET_RELEVANTS,
116                         SQL_STRING);
117     }
118
119 }
120
Popular Tags