KickJava   Java API By Example, From Geeks To Geeks.

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


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.ContentInstanceConstants;
8 import de.webman.content.db.ContentTreeConstants;
9 import de.webman.content.db.ContentVersionConstants;
10
11 /**
12  * Retrieves the description of an existing content from the database.
13  * <TABLE>
14  * <TR>
15  * <TD><B>Order</B></TD>
16  * <TD><B>Name</B></TD>
17  * <TD><B>Type</B></TD>
18  * </TR>
19  * <TR>
20  * <TD COLSPAN="3"><I>Parameters<I/></TD>
21  * </TR>
22  * <TR>
23  * <TD><TT>1</TT></TD>
24  * <TD><TT>de.webman.content.db.ContentConstants.CONTENT_ID</TT></TD>
25  * <TD><TT>java.lang.Integer</TT></TD>
26  * </TR>
27  * <TR>
28  * <TD COLSPAN="3"><I>Results<I/></TD>
29  * </TR>
30  * <TR>
31  * <TD><TT>1</TT></TD>
32  * <TD><TT>de.webman.content.db.ContentTreeConstants.CONTENT_FORM</TT></TD>
33  * <TD><TT>java.lang.Integer</TT></TD>
34  * </TR>
35  * <TR>
36  * <TD><TT>2</TT></TD>
37  * <TD><TT>de.webman.content.db.ContentTreeConstants.CONTENT_NODE_SHORTNAME</TT></TD>
38  * <TD><TT>java.lang.String</TT></TD>
39  * </TR>
40  * <TR>
41  * <TD><TT>3</TT></TD>
42  * <TD><TT>de.webman.content.db.ContentTreeConstants.CONTENT_NODE_NAME</TT></TD>
43  * <TD><TT>java.lang.String</TT></TD>
44  * </TR>
45  * </TABLE>
46  *
47  * @author <A HREF="mailto:unl@webman.de">Ulrich Nicolas Liss&eacute;</A>,
48  * &copy; 2001 Webman AG.
49  * @version $Revision: 1.1 $
50  */

51 public class XMLContentDescribe
52     extends TKPrepQuery
53 {
54     // $Id: XMLContentDescribe.java,v 1.1 2001/09/12 17:49:20 uli Exp $
55

56     // Constants.
57

58     /**
59      * The preparation state.
60      */

61     private final static boolean IS_PREPARED = true;
62
63     /**
64      * The parameter order.
65      */

66     private final static String JavaDoc[] PARAMETER_ORDER =
67     {
68         ContentConstants.CONTENT_ID
69     };
70
71     /**
72      * The parameter types.
73      */

74     private final static Object JavaDoc[][] PARAMETER_TYPES =
75     {
76         {ContentConstants.CONTENT_ID, new Integer JavaDoc(Types.INTEGER)}
77     };
78
79     /**
80      * The relevance state.
81      */

82     private final static boolean[] SET_RELEVANTS =
83     {
84         true
85     };
86
87     /**
88      * The SQL statement.
89      */

90     private final static String JavaDoc SQL_STRING = (new StringBuffer JavaDoc()).append("SELECT CONTENT_TREE.CONTENT_FORM, CONTENT_TREE.CONTENT_NODE_SHORTNAME, CONTENT_TREE.CONTENT_NODE_NAME ")
91                                                                  .append("FROM CONTENT, CONTENT_VERSION, CONTENT_INSTANCE, CONTENT_TREE ")
92                                                                  .append("WHERE CONTENT.CONTENT_ID = ? ")
93                                                                  .append("AND CONTENT.CONTENT_ID = CONTENT_VERSION.CONTENT_ID ")
94                                                                  .append("AND CONTENT_VERSION.INSTANCE_ID = CONTENT_INSTANCE.INSTANCE_ID ")
95                                                                  .append("AND CONTENT_INSTANCE.CONTENT_NODE_ID = CONTENT_TREE.CONTENT_NODE_ID")
96                                                                  .toString();
97
98
99     // Implementation of 'com.teamkonzept.db.TKQuery'
100

101     /**
102      * Initializes the query with the given connection.
103      *
104      * @param connection the connection.
105      */

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