KickJava   Java API By Example, From Geeks To Geeks.

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


1 package de.webman.acl.db;
2
3 import java.sql.ResultSet JavaDoc;
4 import java.sql.SQLException JavaDoc;
5 import com.teamkonzept.db.TKQuery;
6 import de.webman.acl.Action;
7
8 /**
9  * $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/db/ActionDBData.java,v 1.1 2001/08/20 08:25:08 mischa Exp $
10  *
11  * Data container for actions.
12  *
13  * @version 0.10
14  * @since 0.10
15  * @author © 2000 Team-Konzept
16  */

17 public class ActionDBData
18     extends ObjectDBData
19 {
20
21     // Attributes
22

23     /**
24      * The name field of the data container.
25      */

26     private String JavaDoc name = null;
27
28
29     // Constructors
30

31     /**
32      * Creates a data container for actions.
33      *
34      * @param id the ID of the action.
35      * @param name the name of the action.
36      */

37     public ActionDBData (Integer JavaDoc id,
38                            String JavaDoc name)
39     {
40         super(id);
41
42         this.name = name;
43     }
44
45     /**
46      * Creates a data container for actions.
47      *
48      * @param action the action.
49      */

50     public ActionDBData (Action action)
51     {
52         super(action);
53
54         this.name = action.getName();
55     }
56
57
58     // Method implementations
59

60     /**
61      * Returns the database interface.
62      *
63      * @return the database interface.
64      */

65     public final ObjectDBInterface getDBInterface ()
66     {
67         return ActionDBInterface.getInstance();
68     }
69
70     /**
71      * Inserts initial data into the given query.
72      * <P>
73      * This method is used for <CODE>INSERT</CODE> statements.
74      *
75      * @param query the query to be executed.
76      * @exception java.sql.SQLException if an database error occured.
77      */

78     public void insertInitialIntoQuery (TKQuery query)
79         throws SQLException JavaDoc
80     {
81         super.insertInitialIntoQuery(query);
82
83         query.setQueryParams("NAME", this.name);
84     }
85
86     /**
87      * Reads all data from the given result set.
88      * <P>
89      * This method is used for <CODE>SELECT</CODE> and
90      * <CODE>INSERT</CODE> statements.
91      *
92      * @param result the result set to be read.
93      * @exception java.sql.SQLException if an database error occured.
94      */

95     public void fill (ResultSet JavaDoc result)
96         throws SQLException JavaDoc
97     {
98         this.name = result.getString("NAME");
99
100         super.fill(result);
101     }
102
103     /**
104      * Returns the name field of the data container.
105      *
106      * @return the name field of the data container.
107      */

108     public final String JavaDoc getName ()
109     {
110         return this.name;
111     }
112
113 }
114
Popular Tags