KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > dbmetatreemodel > DBMetaColumnNode


1 package org.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel;
2 /* Copyright 2002-2005 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 /**
18  * This class represents a columns of a table
19  * @author <a HREF="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
20  * @version $Id: DBMetaColumnNode.java,v 1.1.2.1 2005/12/21 22:32:42 tomdz Exp $
21  */

22 public class DBMetaColumnNode extends ReverseDbTreeNode
23     implements java.io.Serializable JavaDoc
24 {
25     static final long serialVersionUID = -7694494988930854647L;
26     /** Key for accessing the column name in the attributes Map */
27     public static final String JavaDoc ATT_COLUMN_NAME = "Column Name";
28     
29     /** Creates a new instance of DBMetaSchemaNode
30      * @param pdbMeta DatabaseMetaData implementation where this node gets its data from.
31      * @param pdbMetaTreeModel The TreeModel this node is associated to.
32      * @param pschemaNode The parent node for this node.
33      * @param pstrColumnName The name of the column this node is representing.
34      */

35     public DBMetaColumnNode(java.sql.DatabaseMetaData JavaDoc pdbMeta,
36                             DatabaseMetaDataTreeModel pdbMetaTreeModel,
37                             DBMetaTableNode ptableNode, String JavaDoc pstrColumnName)
38     {
39         super(pdbMeta, pdbMetaTreeModel, ptableNode);
40         this.setAttribute(ATT_COLUMN_NAME, pstrColumnName);
41     }
42     
43     /**
44      * @see ReverseDbTreeNode#isLeaf()
45      */

46     public boolean getAllowsChildren()
47     {
48         return false;
49     }
50     
51     /**
52      * @see ReverseDbTreeNode#getAllowsChildren()
53      */

54     public boolean isLeaf()
55     {
56         return true;
57     }
58     
59     
60     /**
61      * @see Object#toString()
62      */

63     public String JavaDoc toString()
64     {
65         return this.getAttribute(ATT_COLUMN_NAME).toString();
66     }
67
68     public Class JavaDoc getPropertyEditorClass()
69     {
70         return org.apache.ojb.tools.mapping.reversedb2.propertyEditors.JPnlPropertyEditorDBMetaColumn.class;
71     }
72     
73     
74     /**
75      * Do nothing as there are no children for a column.
76      */

77     protected boolean _load ()
78     {
79         return true;
80     }
81 }
82
Popular Tags