01: package org.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /**
19: * This class represents a columns of a table
20: * @author <a href="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
21: * @version $Id: DBMetaColumnNode.java,v 1.1.2.1 2005/12/21 22:32:42 tomdz Exp $
22: */
23: public class DBMetaColumnNode extends ReverseDbTreeNode implements
24: java.io.Serializable {
25: static final long serialVersionUID = -7694494988930854647L;
26: /** Key for accessing the column name in the attributes Map */
27: public static final String 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 pdbMeta,
36: DatabaseMetaDataTreeModel pdbMetaTreeModel,
37: DBMetaTableNode ptableNode, String pstrColumnName) {
38: super (pdbMeta, pdbMetaTreeModel, ptableNode);
39: this .setAttribute(ATT_COLUMN_NAME, pstrColumnName);
40: }
41:
42: /**
43: * @see ReverseDbTreeNode#isLeaf()
44: */
45: public boolean getAllowsChildren() {
46: return false;
47: }
48:
49: /**
50: * @see ReverseDbTreeNode#getAllowsChildren()
51: */
52: public boolean isLeaf() {
53: return true;
54: }
55:
56: /**
57: * @see Object#toString()
58: */
59: public String toString() {
60: return this .getAttribute(ATT_COLUMN_NAME).toString();
61: }
62:
63: public Class getPropertyEditorClass() {
64: return org.apache.ojb.tools.mapping.reversedb2.propertyEditors.JPnlPropertyEditorDBMetaColumn.class;
65: }
66:
67: /**
68: * Do nothing as there are no children for a column.
69: */
70: protected boolean _load() {
71: return true;
72: }
73: }
|