com.googlecode.jdbw.metadata
Class Schema
java.lang.Object
com.googlecode.jdbw.metadata.Schema
- All Implemented Interfaces:
- Comparable<Schema>
public class Schema
- extends Object
- implements Comparable<Schema>
In database terminology, especially in the JDBC world, a Schema is a
middle level organizational container. Owner by a Catalog, a Schema
will be the owner of tables, system tables, stored procedures, function and
views. A catalog may contain one or more schemas, but it's not uncommon among
database servers to provide only one per catalog by default (you have to
create more yourself), normally called PUBLIC.
- Author:
- Martin Berglund
Schema
public Schema(MetaDataResolver metaDataResolver,
Catalog catalog,
String name)
getCatalog
public Catalog getCatalog()
- Returns:
- Catalog owning this schema
getName
public String getName()
- Returns:
- Name of the schema
getTables
public List<Table> getTables()
throws SQLException
- Returns:
- List of all tables in this schema
- Throws:
SQLException - If an error occurred while reading the list of tables
getTableMap
public Map<String,Table> getTableMap()
throws SQLException
- Returns:
- Map (table name to
Table object) of all tables in this
schema
- Throws:
SQLException - If an error occurred while reading the list of tables
getTable
public Table getTable(String tableName)
throws SQLException
- Creates and returns a
Table object for a particular table.
- Parameters:
tableName - Name of the table to get the Table object for
- Returns:
Table representing the table or null if there was no
table in the schema with this name
- Throws:
SQLException - If an error occurred while reading the list of tables
getViews
public List<View> getViews()
throws SQLException
- Returns:
- List of all views in this schema
- Throws:
SQLException - If an error occurred while reading the list of views
getStoredProcedures
public List<StoredProcedure> getStoredProcedures()
throws SQLException
- Returns:
- List of all stored procedures in this schema
- Throws:
SQLException - If an error occurred while reading the list of stored
procedures
compareTo
public int compareTo(Schema o)
- Specified by:
compareTo in interface Comparable<Schema>
toString
public String toString()
- Overrides:
toString in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
Copyright © 2012. All Rights Reserved.