butler.sql.metadata
Class GeneratedSchema
java.lang.Object
butler.util.BaseGroovyObjectSupport
butler.sql.metadata.Schema
butler.sql.metadata.GeneratedSchema
- All Implemented Interfaces:
- groovy.lang.GroovyObject
- Direct Known Subclasses:
- DomainPrefixSchema
public class GeneratedSchema
- extends Schema
Subclass of Schema that should be used as a base class
for custom schemas that contains generated table classes.
This schema will not look for the tables in the databases.
The generated table classes need to be in the same
package or registered.
- Author:
- Fredrik Bertilsson
Method Summary |
Table |
getTable(java.lang.Class tableClass)
Returns a Table class instance of the given class. |
Table |
getTable(java.lang.String name)
Returns the table with the given name. |
protected void |
registerTableClass(java.lang.String tableName,
java.lang.Class tableClass)
Register a table name with a Table subclass. |
Methods inherited from class butler.sql.metadata.Schema |
addRecordListener, addTable, createTable, equals, equals, getAlias, getCatalog, getDatatype, getName, getPath, getProperty, getRecordComparator, getRecordListeners, getResourceBundleBaseName, getSchema, getTableNames, getTables, loadTables, setAlias, setCatalog, setDescriptor, setDictionaryFile, setRecordComparator, setResourceBundleBaseName, setUseName, toXML, upgrade, useName |
Methods inherited from class butler.util.BaseGroovyObjectSupport |
getMetaClass, invokeMethod, setMetaClass, setProperty |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GeneratedSchema
public GeneratedSchema(java.lang.String alias,
Catalog cat)
registerTableClass
protected void registerTableClass(java.lang.String tableName,
java.lang.Class tableClass)
- Register a table name with a Table subclass.
getTable
public Table getTable(java.lang.String name)
throws java.lang.Exception
- Returns the table with the given name. First it looks for
any registered table classes and returns an instance. Otherwise
the table class is expected to be in the same package as the
GeneretedSchema subclass and have the name that starts with
the table name and ends with the suffix "Table". The first letter
should be a capital.
- Overrides:
getTable
in class Schema
- Throws:
java.lang.Exception
getTable
public Table getTable(java.lang.Class tableClass)
throws java.lang.Exception
- Returns a Table class instance of the given class.
- Throws:
java.lang.Exception