KickJava   Java API By Example, From Geeks To Geeks.

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


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/RoleDBInterface.java,v 1.1 2001/08/20 08:25:08 mischa Exp $
7  *
8  * Database interface for roles.
9  *
10  * @version 0.10
11  * @since 0.10
12  * @author © 2000 Team-Konzept
13  */

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

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

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

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

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

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

43     public static final Class JavaDoc WM_ROLE_TASK_SELECT_BY_TASK = RoleTaskSelectByTask.class;
44
45     /**
46      * Insertion class.
47      */

48     public static final Class JavaDoc WM_ROLE_TASK_INSERT = RoleTaskInsert.class;
49
50     /**
51      * Singleton instance.
52      */

53     private static final RoleDBInterface INSTANCE = new RoleDBInterface();
54
55
56     // Constructors
57

58     /**
59      * Inhibits instantiation from outside.
60      */

61     private RoleDBInterface ()
62     {
63         super(RoleInsert.class,
64               RoleUpdate.class,
65               RoleSelect.class,
66               RoleDelete.class,
67               new Class JavaDoc[1],
68               new Class JavaDoc[1],
69               RoleDeleteDependent.class);
70     }
71
72
73     // Instance
74

75     /**
76      * Returns the singleton instance of the database interface.
77      *
78      * @return the singleton instance of the database interface.
79      */

80     public static final RoleDBInterface getInstance ()
81     {
82         return INSTANCE;
83     }
84
85
86     // Method implementations
87

88     /**
89      * Returns the name of the database table.
90      *
91      * @return the name of the database table.
92      */

93     public final String JavaDoc getTableName ()
94     {
95         return TABLE_NAME;
96     }
97
98     /**
99      * Returns the name of the primary key.
100      *
101      * @return the name of the primary key.
102      */

103     public final String JavaDoc getPrimaryKeyName ()
104     {
105         return PRIMARY_KEY_NAME;
106     }
107
108     /**
109      * Returns the name of the dependent key.
110      *
111      * @return the name of the dependent key.
112      */

113     public final String JavaDoc getDependentKeyName ()
114     {
115         return TaskDBInterface.PRIMARY_KEY_NAME;
116     }
117
118     /**
119      * Returns the query for selection of all objects.
120      *
121      * @return the query for selection of all objects.
122      */

123     public final Class JavaDoc getSelectAllQuery ()
124     {
125         return WM_ROLE_SELECT_ALL;
126     }
127
128     /**
129      * Returns the query for selection of all dependent objects.
130      *
131      * @return the query for selection of all dependent objects.
132      */

133     public final Class JavaDoc getSelectDependentQuery ()
134     {
135         return WM_ROLE_TASK_SELECT_BY_ROLE;
136     }
137
138     /**
139      * Returns the query for insertion of all dependent objects.
140      *
141      * @return the query for insertion of all dependent objects.
142      */

143     public final Class JavaDoc getInsertDependentQuery ()
144     {
145         return WM_ROLE_TASK_INSERT;
146     }
147
148 }
149
Popular Tags