001: package de.webman.content.db.queries;
002:
003: import java.sql.Connection;
004: import java.sql.Types;
005: import com.teamkonzept.db.TKPrepQuery;
006: import de.webman.content.db.ContentConstants;
007: import de.webman.content.db.StructuredContentConstants;
008: import de.webman.form.db.FormConstants;
009:
010: /**
011: * Retrieves an existing structured content from the database.
012: * <TABLE>
013: * <TR>
014: * <TD><B>Order</B></TD>
015: * <TD><B>Name</B></TD>
016: * <TD><B>Type</B></TD>
017: * </TR>
018: * <TR>
019: * <TD COLSPAN="3"><I>Parameters<I/></TD>
020: * </TR>
021: * <TR>
022: * <TD><TT>1</TT></TD>
023: * <TD><TT>de.webman.content.db.ContentConstants.CONTENT_ID</TT></TD>
024: * <TD><TT>java.lang.Integer</TT></TD>
025: * </TR>
026: * <TR>
027: * <TD COLSPAN="3"><I>Results<I/></TD>
028: * </TR>
029: * <TR>
030: * <TD><TT>1</TT></TD>
031: * <TD><TT>de.webman.content.db.ContentConstants.XML_TEXT</TT></TD>
032: * <TD><TT>java.lang.String</TT></TD>
033: * </TR>
034: * <TR>
035: * <TD><TT>2</TT></TD>
036: * <TD><TT>de.webman.content.db.StructuredContentConstants.FORM_ID</TT></TD>
037: * <TD><TT>java.lang.Integer</TT></TD>
038: * </TR>
039: * <TR>
040: * <TD><TT>3</TT></TD>
041: * <TD><TT>de.webman.form.db.FormConstants.FORM_NAME</TT></TD>
042: * <TD><TT>java.lang.String</TT></TD>
043: * </TR>
044: * <TR>
045: * <TD><TT>4</TT></TD>
046: * <TD><TT>de.webman.form.db.FormConstants.FORM_DESCRIPTION</TT></TD>
047: * <TD><TT>java.lang.String</TT></TD>
048: * </TR>
049: * </TABLE>
050: *
051: * @author <A HREF="mailto:unl@webman.de">Ulrich Nicolas Lissé</A>,
052: * © 2001 Webman AG.
053: * @version $Revision: 1.1 $
054: */
055: public class XMLStructuredContentRetrieve extends TKPrepQuery {
056: // $Id: XMLStructuredContentRetrieve.java,v 1.1 2001/09/28 14:50:36 uli Exp $
057:
058: // Constants.
059:
060: /**
061: * The preparation state.
062: */
063: private final static boolean IS_PREPARED = true;
064:
065: /**
066: * The parameter order.
067: */
068: private final static String[] PARAMETER_ORDER = { ContentConstants.CONTENT_ID };
069:
070: /**
071: * The parameter types.
072: */
073: private final static Object[][] PARAMETER_TYPES = { {
074: ContentConstants.CONTENT_ID, new Integer(Types.INTEGER) } };
075:
076: /**
077: * The relevance state.
078: */
079: private final static boolean[] SET_RELEVANTS = { true };
080:
081: /**
082: * The SQL statement.
083: */
084: private final static String SQL_STRING = (new StringBuffer())
085: .append(
086: "SELECT CONTENT.XML_TEXT, STRUCTURED_CONTENT.FORM_ID, FORM.FORM_NAME, FORM.FORM_DESCRIPTION ")
087: .append("FROM CONTENT, STRUCTURED_CONTENT, FORM ")
088: .append("WHERE CONTENT.CONTENT_ID = ? ")
089: .append(
090: "AND CONTENT.CONTENT_ID = STRUCTURED_CONTENT.CONTENT_ID ")
091: .append("AND STRUCTURED_CONTENT.FORM_ID = FORM.FORM_ID")
092: .toString();
093:
094: // Implementation of 'com.teamkonzept.db.TKQuery'
095:
096: /**
097: * Initializes the query with the given connection.
098: *
099: * @param connection the connection.
100: */
101: public void initQuery(Connection connection) {
102: super.initQuery(connection, IS_PREPARED, PARAMETER_ORDER,
103: PARAMETER_TYPES, SET_RELEVANTS, SQL_STRING);
104: }
105:
106: }
|