dk.eobjects.metamodel.schema
Class Schema

Package class diagram package Schema
java.lang.Object
  extended by dk.eobjects.metamodel.schema.Schema
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Schema>
Direct Known Subclasses:
CompositeSchema, JdbcSchema

public class Schema
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<Schema>

Represents a schema and it's metadata. Schemas represent a collection of tables.

See Also:
Table, Serialized Form

Field Summary
protected  java.lang.String _name
           
protected  java.util.List<Table> _tables
           
 
Constructor Summary
Schema()
           
Schema(java.lang.String name)
           
Schema(java.lang.String name, Table... tables)
           
 
Method Summary
 Schema addTable(Table table)
           
 int compareTo(Schema that)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 int getRelationshipCount()
           
 Relationship[] getRelationships()
           
 Table getTableByName(java.lang.String tableName)
          Convenience method for retrieving a table by it's name
 int getTableCount()
           
 int getTableCount(TableType type)
           
 java.lang.String[] getTableNames()
           
 Table[] getTables()
           
 Table[] getTables(TableType type)
           
 int hashCode()
           
 Schema removeTable(Table table)
           
 Schema setName(java.lang.String name)
           
 Schema setTables(java.util.Collection<Table> tables)
           
 Schema setTables(Table... tables)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

protected java.lang.String _name

_tables

protected java.util.List<Table> _tables
Constructor Detail

Schema

public Schema()

Schema

public Schema(java.lang.String name)

Schema

public Schema(java.lang.String name,
              Table... tables)
Method Detail

getName

public java.lang.String getName()
Returns:
the name of the schema

setName

public Schema setName(java.lang.String name)

getTableCount

public int getTableCount()
Returns:
the number of tables that reside in the schema

getTableCount

public int getTableCount(TableType type)

getTables

public Table[] getTables()
Returns:
the tables that reside in the schema

getTables

public Table[] getTables(TableType type)

setTables

public Schema setTables(java.util.Collection<Table> tables)

setTables

public Schema setTables(Table... tables)

addTable

public Schema addTable(Table table)

removeTable

public Schema removeTable(Table table)

getTableByName

public Table getTableByName(java.lang.String tableName)
Convenience method for retrieving a table by it's name

Parameters:
tableName - the name of the table to retrieve
Returns:
the table with the given name. Returns null if no such table is found.

getRelationships

public Relationship[] getRelationships()

getRelationshipCount

public int getRelationshipCount()

toString

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

hashCode

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

equals

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

compareTo

public int compareTo(Schema that)
Specified by:
compareTo in interface java.lang.Comparable<Schema>

getTableNames

public java.lang.String[] getTableNames()


Copyright © 2007-2010. All Rights Reserved.