org.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel
Class DBMetaSchemaNode

java.lang.Object
  extended byorg.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
      extended byorg.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel.ReverseDbTreeNode
          extended byorg.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel.DBMetaSchemaNode
All Implemented Interfaces:
PropertyEditorTarget, java.io.Serializable, javax.swing.tree.TreeNode

public class DBMetaSchemaNode
extends ReverseDbTreeNode
implements java.io.Serializable

This node represents a schema of the database. Its children are DBMetaTableNode objects. Not all databases support schemas (e.g. MySQL), so the schema name may be null.

Version:
$Id: DBMetaSchemaNode.java,v 1.4 2004/01/07 11:41:20 thma Exp $
Author:
Florian Bruckner
See Also:
Serialized Form

Field Summary
static java.lang.String ATT_SCHEMA_NAME
          Key for accessing the schema name in the attributes Map
(package private) static long serialVersionUID
           
 
Fields inherited from class org.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel.ReverseDbTreeNode
alChildren
 
Fields inherited from class org.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
propertyChangeDelegate
 
Constructor Summary
DBMetaSchemaNode(java.sql.DatabaseMetaData pdbMeta, DatabaseMetaDataTreeModel pdbMetaTreeModel, DBMetaCatalogNode pcatalogNode, java.lang.String pstrSchemaName)
          Creates a new instance of DBMetaSchemaNode
 
Method Summary
protected  boolean _load()
          Fills the children list with the tables this schema contains.
 boolean getAllowsChildren()
           
 DBMetaCatalogNode getCatalog()
          Convenience access method to the catalog this schema is associated to.
 java.lang.Class getPropertyEditorClass()
          Return the property editor class for this PropertyEditorTarget.
 java.lang.String getSchemaName()
          Convenience access method for the schema name.
 boolean isLeaf()
           
 java.lang.String toString()
          If the schema name is specified, returns the schema name, otherwise a constant string indicating that the schema name is emtpy (which is legal for some databases, e.g.
 
Methods inherited from class org.apache.ojb.tools.mapping.reversedb2.dbmetatreemodel.ReverseDbTreeNode
children, getChildAt, getChildCount, getDbMeta, getDbMetaTreeModel, getIndex, getParent, load, loadWait
 
Methods inherited from class org.apache.ojb.tools.mapping.reversedb2.propertyEditors.EditableTreeNodeWithProperties
addPropertyChangeListener, addPropertyChangeListener, getAttribute, removePropertyChangeListener, removePropertyChangeListener, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

ATT_SCHEMA_NAME

public static final java.lang.String ATT_SCHEMA_NAME
Key for accessing the schema name in the attributes Map

See Also:
Constant Field Values
Constructor Detail

DBMetaSchemaNode

public DBMetaSchemaNode(java.sql.DatabaseMetaData pdbMeta,
                        DatabaseMetaDataTreeModel pdbMetaTreeModel,
                        DBMetaCatalogNode pcatalogNode,
                        java.lang.String pstrSchemaName)
Creates a new instance of DBMetaSchemaNode

Parameters:
pdbMeta - DatabaseMetaData implementation where this node gets its data from.
pdbMetaTreeModel - The TreeModel this node is associated to.
pcatalogNode - The parent node for this node.
pstrSchemaName - The name of the schema this node is representing. Some databases do not support schemas, therefore null values are allowed for this parameter
Method Detail

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode
Specified by:
getAllowsChildren in class ReverseDbTreeNode
See Also:
ReverseDbTreeNode.isLeaf()

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Specified by:
isLeaf in class ReverseDbTreeNode
See Also:
ReverseDbTreeNode.getAllowsChildren()

getSchemaName

public java.lang.String getSchemaName()
Convenience access method for the schema name. Accesses the attributes HashMap to retrieve the value.


toString

public java.lang.String toString()
If the schema name is specified, returns the schema name, otherwise a constant string indicating that the schema name is emtpy (which is legal for some databases, e.g. MySQL)

See Also:
Object.toString()

getCatalog

public DBMetaCatalogNode getCatalog()
Convenience access method to the catalog this schema is associated to.


getPropertyEditorClass

public java.lang.Class getPropertyEditorClass()
Description copied from interface: PropertyEditorTarget
Return the property editor class for this PropertyEditorTarget. Depending on the GUI implementation this could for example be an extension of JPanel. The Property editor is responsible for the layout, so the property editor has to know which properties this target has.

Specified by:
getPropertyEditorClass in interface PropertyEditorTarget

_load

protected boolean _load()
Fills the children list with the tables this schema contains.

Specified by:
_load in class ReverseDbTreeNode


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14