org.eobjects.metamodel.schema
Class AbstractSchema

java.lang.Object
  extended by org.eobjects.metamodel.schema.AbstractSchema
All Implemented Interfaces:
Serializable, Comparable<Schema>, NamedStructure, Schema, HasName
Direct Known Subclasses:
CompositeSchema, ImmutableSchema, MutableSchema

public abstract class AbstractSchema
extends Object
implements Schema

Abstract implementation of the Schema interface. Implements most common and trivial methods.

Author:
Kasper Sørensen
See Also:
Serialized Form

Constructor Summary
AbstractSchema()
           
 
Method Summary
 int compareTo(Schema that)
           
 boolean equals(Object obj)
           
 String getQualifiedLabel()
          Gets a qualified label for later lookup.
 String getQuotedName()
          Gets the name, including optional quotes, of this structure.
 int getRelationshipCount()
          Gets the number of relationships to and from this Schema.
 Relationship[] getRelationships()
          Gets all relationships to and from this Schema.
 Table getTable(int index)
          Gets a table by index.
 Table getTableByName(String tableName)
          Convenience method for retrieving a table by it's name.
 int getTableCount()
          Gets the number of tables that reside in this schema.
 int getTableCount(TableType type)
          Gets the number of tables in this Schema that comply to a given TableType.
 String[] getTableNames()
          Gets the names of the tables that reside in this Schema.
 Table[] getTables(TableType type)
          Gets all tables in this Schema of a particular type.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.schema.Schema
getName, getTables
 
Methods inherited from interface org.eobjects.metamodel.schema.NamedStructure
getQuote
 

Constructor Detail

AbstractSchema

public AbstractSchema()
Method Detail

getQuotedName

public final String getQuotedName()
Description copied from interface: NamedStructure
Gets the name, including optional quotes, of this structure.

Specified by:
getQuotedName in interface NamedStructure
Returns:
The name of the structure with added quote strings.

getRelationships

public Relationship[] getRelationships()
Description copied from interface: Schema
Gets all relationships to and from this Schema.

Specified by:
getRelationships in interface Schema
Returns:
an array of relationships.

getTable

public Table getTable(int index)
               throws IndexOutOfBoundsException
Description copied from interface: Schema
Gets a table by index. Use Schema.getTableCount() to get the (0-based) index range

Specified by:
getTable in interface Schema
Parameters:
index - the index of the table
Returns:
the column with the specified index
Throws:
IndexOutOfBoundsException - if the index is out of bounds (index >= table count)

getQualifiedLabel

public final String getQualifiedLabel()
Description copied from interface: NamedStructure
Gets a qualified label for later lookup. Typically this qualified label is formatted with a simple dot separator. For example, for a column a typical qualified label would be: "MY_SCHEMA.MY_TABLE.MY_COLUMN". The qualified label can be used as a unique identifier for the structure but is not necessarily directly transferable to SQL syntax.

Specified by:
getQualifiedLabel in interface NamedStructure
Returns:
a qualified label

getTableCount

public final int getTableCount(TableType type)
Description copied from interface: Schema
Gets the number of tables in this Schema that comply to a given TableType.

Specified by:
getTableCount in interface Schema
Parameters:
type - the TableType to use for searching and matching.
Returns:
the count of tables that match the provided TableType.

getRelationshipCount

public final int getRelationshipCount()
Description copied from interface: Schema
Gets the number of relationships to and from this Schema.

Specified by:
getRelationshipCount in interface Schema
Returns:
the number of relationships to and from this Schema

getTableCount

public final int getTableCount()
Description copied from interface: Schema
Gets the number of tables that reside in this schema.

Specified by:
getTableCount in interface Schema
Returns:
the number of tables that reside in this schema.

getTables

public final Table[] getTables(TableType type)
Description copied from interface: Schema
Gets all tables in this Schema of a particular type.

Specified by:
getTables in interface Schema
Parameters:
type - the TableType to use for searching and matching.
Returns:
an array of tables in this schema that matches the specified type.

getTableByName

public final Table getTableByName(String tableName)
Description copied from interface: Schema
Convenience method for retrieving a table by it's name.

Specified by:
getTableByName in interface Schema
Parameters:
tableName - the name of the table to retrieve
Returns:
the table with the given name. Returns null if no such table is found.

getTableNames

public final String[] getTableNames()
Description copied from interface: Schema
Gets the names of the tables that reside in this Schema.

Specified by:
getTableNames in interface Schema
Returns:
an array of table names.

toString

public final String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public final int compareTo(Schema that)
Specified by:
compareTo in interface Comparable<Schema>


Copyright © 2007-2013. All Rights Reserved.