org.eobjects.metamodel.schema
Interface Schema

All Superinterfaces:
Comparable<Schema>, HasName, NamedStructure, Serializable
All Known Implementing Classes:
AbstractSchema, CompositeSchema, ImmutableSchema, MutableSchema

public interface Schema
extends Comparable<Schema>, Serializable, NamedStructure

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

Author:
Kasper Sørensen
See Also:
DataContext, Table

Method Summary
 String getName()
          Gets the name of this Schema
 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()
          Gets all tables in this Schema.
 Table[] getTables(TableType type)
          Gets all tables in this Schema of a particular type.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.eobjects.metamodel.schema.NamedStructure
getQualifiedLabel, getQuote, getQuotedName
 

Method Detail

getName

String getName()
Gets the name of this Schema

Specified by:
getName in interface HasName
Specified by:
getName in interface NamedStructure
Returns:
the name of this Schema

getTableCount

int getTableCount()
Gets the number of tables that reside in this schema.

Returns:
the number of tables that reside in this schema.

getTableCount

int getTableCount(TableType type)
Gets the number of tables in this Schema that comply to a given TableType.

Parameters:
type - the TableType to use for searching and matching.
Returns:
the count of tables that match the provided TableType.

getTableNames

String[] getTableNames()
Gets the names of the tables that reside in this Schema.

Returns:
an array of table names.

getTables

Table[] getTables()
Gets all tables in this Schema.

Returns:
the tables that reside in the schema

getTables

Table[] getTables(TableType type)
Gets all tables in this Schema of a particular type.

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

getTable

Table getTable(int index)
               throws IndexOutOfBoundsException
Gets a table by index. Use getTableCount() to get the (0-based) index range

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)

getTableByName

Table getTableByName(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

Relationship[] getRelationships()
Gets all relationships to and from this Schema.

Returns:
an array of relationships.

getRelationshipCount

int getRelationshipCount()
Gets the number of relationships to and from this Schema.

Returns:
the number of relationships to and from this Schema


Copyright © 2007-2013. All Rights Reserved.