01: package de.webman.acl.db.queries.sybase;
02:
03: import java.sql.Connection;
04: import java.sql.Types;
05: import com.teamkonzept.db.TKPrepQuery;
06:
07: /**
08: * $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/db/queries/sybase/TaskInsert.java,v 1.1 2001/09/19 12:02:02 markus Exp $
09: *
10: * @version 0.10
11: * @since 0.10
12: * @author © 2000 Team-Konzept
13: */
14: public class TaskInsert extends TKPrepQuery {
15:
16: // Constants
17:
18: public static final String[] ORDER = { "NAME", "WM_CONTEXT_ID" };
19:
20: public static final Object[][] TYPES = {
21: { "NAME", new Integer(Types.VARCHAR) },
22: { "WM_CONTEXT_ID", new Integer(Types.INTEGER) } };
23:
24: public static final boolean[] RELEVANTS = { true };
25:
26: public static final String SQL = (new StringBuffer())
27: .append("DECLARE @ID INT ")
28: .append(
29: "SELECT @ID = ISNULL(MAX(WM_TASK_ID) + 1, 1) FROM WM_TASK ")
30: .append(
31: "INSERT INTO WM_TASK (WM_TASK_ID, NAME, WM_CONTEXT_ID) VALUES (@ID, ?, ?) ")
32: .append("SELECT * FROM WM_TASK WHERE WM_TASK_ID = @ID")
33: .toString();
34:
35: // Method implementations
36:
37: public void initQuery(Connection connection) {
38: super .initQuery(connection, true, ORDER, TYPES, RELEVANTS, SQL);
39: }
40:
41: }
|