org.unitils.dbunit.dataset
Class Schema

java.lang.Object
  extended by org.unitils.dbunit.dataset.Schema

public class Schema
extends Object

A data set schema

Author:
Tim Ducheyne, Filip Neven

Constructor Summary
Schema(String name)
          Creates a data set schema.
 
Method Summary
 void addTable(Table table)
          Adds a table to the schema.
 SchemaDifference compare(Schema actualSchema)
          Compares the schema with the given actual schema.
 String getName()
           
 Table getTable(String tableName)
          Gets the table for the given name.
 List<String> getTableNames()
           
 List<Table> getTables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Schema

public Schema(String name)
Creates a data set schema.

Parameters:
name - The name of the schema, not null
Method Detail

getName

public String getName()
Returns:
The name of the data set schema, not null

getTables

public List<Table> getTables()
Returns:
The tables of the schema, not null

getTableNames

public List<String> getTableNames()
Returns:
The names of the tables of the schema, not null

getTable

public Table getTable(String tableName)
Gets the table for the given name. The name is case insensitive.

Parameters:
tableName - The table name to look for, not null
Returns:
The table, null if not found

addTable

public void addTable(Table table)
Adds a table to the schema. Only one table with a same name can be added.

Parameters:
table - The table to add, not null
Throws:
UnitilsException - When a table with the same name was already added

compare

public SchemaDifference compare(Schema actualSchema)
Compares the schema with the given actual schema.

Parameters:
actualSchema - The schema to compare with, not null
Returns:
The difference, null if none found


Copyright © 2011. All Rights Reserved.