ca.sqlpower.architect
Class SQLCatalog

java.lang.Object
  extended by ca.sqlpower.architect.SQLObject
      extended by ca.sqlpower.architect.SQLCatalog
All Implemented Interfaces:
java.io.Serializable

public class SQLCatalog
extends SQLObject

A SQLCatalog is a container for other SQLObjects. If it is in the containment hierarchy for a given RDBMS, it will be directly under SQLDatabase.

See Also:
Serialized Form

Field Summary
protected  java.lang.String nativeTerm
          The term used for catalogs in the native database system.
protected  SQLObject parent
           
 
Fields inherited from class ca.sqlpower.architect.SQLObject
children, magicDisableCount, populated, undoEventListeners
 
Constructor Summary
SQLCatalog()
           
SQLCatalog(SQLDatabase parent, java.lang.String name)
           
SQLCatalog(SQLDatabase parent, java.lang.String name, boolean startPopulated)
           
 
Method Summary
 boolean allowsChildren()
          Returns true if and only if this object can have child SQLObjects.
 java.lang.Class<? extends SQLObject> getChildType()
           
 java.lang.String getNativeTerm()
          Gets the value of nativeTerm
 SQLObject getParent()
          Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.
 SQLDatabase getParentDatabase()
           
 SQLSchema getSchemaByName(java.lang.String schemaName)
           
 java.lang.String getShortDisplayName()
          Returns a short string that should be displayed to the user for representing this SQLObject as a label.
protected  SQLTable getTableByName(java.lang.String tableName)
           
 boolean isSchemaContainer()
          Determines whether this SQL object is a container for schemas
 void populate()
          Causes this SQLObject to load its children (if any exist).
 void setNativeTerm(java.lang.String argNativeTerm)
          Sets the value of nativeTerm to a lowercase version of argNativeTerm.
protected  void setParent(SQLObject newParent)
          Parents call this on their children to update parent pointers during addChild and removeChild requests.
 java.lang.String toString()
           
 
Methods inherited from class ca.sqlpower.architect.SQLObject
addChild, addChild, addChildImpl, addSQLObjectListener, addSQLObjectPreEventListener, addUndoEventListener, endCompoundEdit, fireDbChildInserted, fireDbChildPreRemove, fireDbChildRemoved, fireDbChildrenInserted, fireDbChildrenPreRemove, fireDbChildrenRemoved, fireDbObjectChanged, fireDbStructureChanged, getChild, getChildByName, getChildByNameIgnoreCase, getChildCount, getChildren, getIndexOfChildByName, getName, getPhysicalName, getSQLObjectListeners, getSQLObjectPreEventListeners, getUndoEventListeners, isMagicEnabled, isPopulated, removeChild, removeChild, removeImpl, removeSQLObjectListener, removeSQLObjectPreEventListener, removeUndoEventListener, setMagicEnabled, setName, setPhysicalName, setPopulated, startCompoundEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected SQLObject parent

nativeTerm

protected java.lang.String nativeTerm
The term used for catalogs in the native database system. In SQLServer2000, this is "database".

Constructor Detail

SQLCatalog

public SQLCatalog()

SQLCatalog

public SQLCatalog(SQLDatabase parent,
                  java.lang.String name)

SQLCatalog

public SQLCatalog(SQLDatabase parent,
                  java.lang.String name,
                  boolean startPopulated)
Method Detail

getTableByName

protected SQLTable getTableByName(java.lang.String tableName)
                           throws ArchitectException
Throws:
ArchitectException

getSchemaByName

public SQLSchema getSchemaByName(java.lang.String schemaName)
                          throws ArchitectException
Returns:
The schema in this catalog with the given name, or null if no such schema exists.
Throws:
ArchitectException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getParent

public SQLObject getParent()
Description copied from class: SQLObject
Returns the parent of this SQLObject or null if it is a root object such as SQLDatabase.

Specified by:
getParent in class SQLObject

setParent

protected void setParent(SQLObject newParent)
Description copied from class: SQLObject
Parents call this on their children to update parent pointers during addChild and removeChild requests.

Specified by:
setParent in class SQLObject

getShortDisplayName

public java.lang.String getShortDisplayName()
Description copied from class: SQLObject
Returns a short string that should be displayed to the user for representing this SQLObject as a label.

Specified by:
getShortDisplayName in class SQLObject

allowsChildren

public boolean allowsChildren()
Description copied from class: SQLObject
Returns true if and only if this object can have child SQLObjects. Your implementation of this method must not cause JDBC activity, or the lazy loading properties of your SQLObjects will be wasted! Typically, you will implement this with a hardcoded "return true" or "return false" depending on object type.

Specified by:
allowsChildren in class SQLObject

populate

public void populate()
              throws ArchitectException
Description copied from class: SQLObject
Causes this SQLObject to load its children (if any exist). This method will be called lots of times, so track whether or not you need to do anything and return right away whenever possible.

Specified by:
populate in class SQLObject
Throws:
ArchitectException

getParentDatabase

public SQLDatabase getParentDatabase()

getNativeTerm

public java.lang.String getNativeTerm()
Gets the value of nativeTerm

Returns:
the value of nativeTerm

setNativeTerm

public void setNativeTerm(java.lang.String argNativeTerm)
Sets the value of nativeTerm to a lowercase version of argNativeTerm.

Parameters:
argNativeTerm - Value to assign to this.nativeTerm

getChildType

public java.lang.Class<? extends SQLObject> getChildType()
Specified by:
getChildType in class SQLObject

isSchemaContainer

public boolean isSchemaContainer()
                          throws ArchitectException
Determines whether this SQL object is a container for schemas

Returns:
true (the default) if there are no children; false if the first child is not of type SQLSchema.
Throws:
ArchitectException


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca