butler.sql.metadata
Class Catalog

java.lang.Object
  extended by butler.util.BaseGroovyObjectSupport
      extended by butler.sql.metadata.Catalog
All Implemented Interfaces:
groovy.lang.GroovyObject

public class Catalog
extends butler.util.BaseGroovyObjectSupport

Database catalog. A catalog is a container for database schemas.

Author:
Fredrik Bertilsson

Constructor Summary
Catalog(java.lang.String name)
          Constructs a catalog with the given name.
 
Method Summary
 void addSchema(java.lang.String alias, Schema schema)
           
 boolean equals(Catalog other)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getAlias()
           
 Database getDatabase()
          Returns the database to which this catalog belongs.
 Schema getDefaultSchema()
          Returns the default schema.
 java.lang.String getName()
          Returns the name of this catalog.
 java.lang.String getPath()
           
 java.lang.Object getProperty(java.lang.String property)
           
 Schema getSchema(java.lang.String alias)
          Returns the schema with the given alias.
 java.util.Iterator getSchemaNames()
          Returns an iteration of all schema names.
 java.util.Map getSchemas()
          Returns all schemas.
 int hashCode()
           
 void loadSchemas()
           
 void setAlias(java.lang.String alias)
           
 void setDatabase(Database db)
          Sets the database to which this catalog belogs.
 void setDefaultSchema(Schema schema)
           
 void setUseName(boolean value)
          Sets if catalog name should be used in table qualified name.
 void toXML(org.xml.sax.ContentHandler handler)
           
 boolean useName()
          Tells if catalog name should be used in table qualified name.
 
Methods inherited from class butler.util.BaseGroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Catalog

public Catalog(java.lang.String name)
Constructs a catalog with the given name.

Method Detail

setDatabase

public void setDatabase(Database db)
Sets the database to which this catalog belogs.


getName

public java.lang.String getName()
Returns the name of this catalog.


getAlias

public java.lang.String getAlias()

setAlias

public void setAlias(java.lang.String alias)

getSchema

public Schema getSchema(java.lang.String alias)
                 throws java.lang.Exception
Returns the schema with the given alias.

Throws:
java.lang.Exception

addSchema

public void addSchema(java.lang.String alias,
                      Schema schema)

setDefaultSchema

public void setDefaultSchema(Schema schema)

getProperty

public java.lang.Object getProperty(java.lang.String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class butler.util.BaseGroovyObjectSupport

getDefaultSchema

public Schema getDefaultSchema()
                        throws java.lang.Exception
Returns the default schema.

Throws:
java.lang.Exception

getSchemas

public java.util.Map getSchemas()
Returns all schemas.


getSchemaNames

public java.util.Iterator getSchemaNames()
                                  throws java.lang.Exception
Returns an iteration of all schema names.

Throws:
java.lang.Exception

loadSchemas

public void loadSchemas()
                 throws java.lang.Exception
Throws:
java.lang.Exception

getDatabase

public Database getDatabase()
Returns the database to which this catalog belongs.


equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(Catalog other)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toXML

public void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Throws:
java.lang.Exception

useName

public boolean useName()
Tells if catalog name should be used in table qualified name.


setUseName

public void setUseName(boolean value)
Sets if catalog name should be used in table qualified name.


getPath

public java.lang.String getPath()