KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > acl > db > TaskDBInterface


1 package de.webman.acl.db;
2
3 import de.webman.acl.db.queries.*;
4
5 /**
6  * $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/db/TaskDBInterface.java,v 1.1 2001/08/20 08:25:08 mischa Exp $
7  *
8  * Database interface for tasks.
9  *
10  * @version 0.10
11  * @since 0.10
12  * @author © 2000 Team-Konzept
13  */

14 public class TaskDBInterface
15     extends ObjectDBInterface
16 {
17
18     // Constants
19

20     /**
21      * The table name.
22      */

23     public static final String JavaDoc TABLE_NAME = "WM_TASK";
24
25     /**
26      * The primary key name.
27      */

28     public static final String JavaDoc PRIMARY_KEY_NAME = "WM_TASK_ID";
29
30     /**
31      * Selection class.
32      */

33     public static final Class JavaDoc WM_TASK_SELECT_ALL = TaskSelectAll.class;
34
35     /**
36      * Selection class.
37      */

38     public static final Class JavaDoc WM_TASK_SELECT_BY_CONTEXT = TaskSelectByContext.class;
39
40     /**
41      * Selection class.
42      */

43     public static final Class JavaDoc WM_TASK_ACTION_SELECT_BY_TASK = TaskActionSelectByTask.class;
44
45     /**
46      * Selection class.
47      */

48     public static final Class JavaDoc WM_TASK_ACTION_SELECT_BY_ACTION = TaskActionSelectByAction.class;
49
50     /**
51      * Insertion class.
52      */

53     public static final Class JavaDoc WM_TASK_ACTION_INSERT = TaskActionInsert.class;
54
55     /**
56      * Singleton instance.
57      */

58     private static final TaskDBInterface INSTANCE = new TaskDBInterface();
59
60
61     // Constructors
62

63     /**
64      * Inhibits instantiation from outside.
65      */

66     private TaskDBInterface ()
67     {
68         super(TaskInsert.class,
69               TaskUpdate.class,
70               TaskSelect.class,
71               TaskDelete.class,
72               new Class JavaDoc[1],
73               new Class JavaDoc[1],
74               TaskDeleteDependent.class);
75     }
76
77
78     // Instance
79

80     /**
81      * Returns the singleton instance of the database interface.
82      *
83      * @return the singleton instance of the database interface.
84      */

85     public static final TaskDBInterface getInstance ()
86     {
87         return INSTANCE;
88     }
89
90
91     // Method implementations
92

93     /**
94      * Returns the name of the database table.
95      *
96      * @return the name of the database table.
97      */

98     public final String JavaDoc getTableName ()
99     {
100         return TABLE_NAME;
101     }
102
103     /**
104      * Returns the name of the primary key.
105      *
106      * @return the name of the primary key.
107      */

108     public final String JavaDoc getPrimaryKeyName ()
109     {
110         return PRIMARY_KEY_NAME;
111     }
112
113     /**
114      * Returns the name of the dependent key.
115      *
116      * @return the name of the dependent key.
117      */

118     public final String JavaDoc getDependentKeyName ()
119     {
120         return ActionDBInterface.PRIMARY_KEY_NAME;
121     }
122
123     /**
124      * Returns the query for selection of all objects.
125      *
126      * @return the query for selection of all objects.
127      */

128     public final Class JavaDoc getSelectAllQuery ()
129     {
130         return WM_TASK_SELECT_ALL;
131     }
132
133     /**
134      * Returns the query for selection of all dependent objects.
135      *
136      * @return the query for selection of all dependent objects.
137      */

138     public final Class JavaDoc getSelectDependentQuery ()
139     {
140         return WM_TASK_ACTION_SELECT_BY_TASK;
141     }
142
143     /**
144      * Returns the query for insertion of all dependent objects.
145      *
146      * @return the query for insertion of all dependent objects.
147      */

148     public final Class JavaDoc getInsertDependentQuery ()
149     {
150         return WM_TASK_ACTION_INSERT;
151     }
152
153 }
154
Popular Tags