ca.sqlpower.architect
Class SQLSchema

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

public class SQLSchema
extends SQLObject

A SQLSchema is a container for SQLTables. If it is in the containment hierarchy for a given RDBMS, it will be directly above SQLTables. Its parent could be either a SQLDatabase or a SQLCatalog.

See Also:
Serialized Form

Field Summary
protected  java.lang.String nativeTerm
           
protected  SQLObject parent
           
 
Fields inherited from class ca.sqlpower.architect.SQLObject
children, magicDisableCount, populated, undoEventListeners
 
Constructor Summary
SQLSchema(boolean populated)
           
SQLSchema(SQLObject parent, java.lang.String name, boolean populated)
           
 
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.
 java.lang.String getShortDisplayName()
          Returns a short string that should be displayed to the user for representing this SQLObject as a label.
 SQLTable getTableByName(java.lang.String tableName)
           
 boolean isParentTypeDatabase()
           
 void populate()
          Populates this schema from the source database, if there is one.
 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
Constructor Detail

SQLSchema

public SQLSchema(boolean populated)

SQLSchema

public SQLSchema(SQLObject parent,
                 java.lang.String name,
                 boolean populated)
Method Detail

getTableByName

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

toString

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

isParentTypeDatabase

public boolean isParentTypeDatabase()

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
Populates this schema from the source database, if there is one. Schemas that have no parent should not need to be autopopulated, because this makes no sense.

Specified by:
populate in class SQLObject
Throws:
java.lang.NullPointerException - if this schema has no parent database.
ArchitectException

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


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