org.eobjects.metamodel.create
Interface TableCreationBuilder

All Known Subinterfaces:
ColumnCreationBuilder
All Known Implementing Classes:
AbstractTableCreationBuilder

public interface TableCreationBuilder

Builder object for Table creation.

Author:
Kasper Sørensen

Method Summary
 Table execute()
          Commits the built table and requests that the table structure should be written to the DataContext.
 TableCreationBuilder like(Table table)
          Builds this table's columns based on another Table which will be used as a prototype.
 String toSql()
          Gets a SQL representation of this create table operation.
 Table toTable()
          Returns this builder instance as a table.
 ColumnCreationBuilder withColumn(String name)
          Adds a column to the current builder
 

Method Detail

like

TableCreationBuilder like(Table table)
Builds this table's columns based on another Table which will be used as a prototype. Using this method simplifies the creation of a table that is similar to an existing table.

Parameters:
table - the Table to use as a prototype
Returns:
a builder object for further table creation

withColumn

ColumnCreationBuilder withColumn(String name)
Adds a column to the current builder

Parameters:
name -
Returns:

toTable

Table toTable()
Returns this builder instance as a table. This allows for inspecting the table that is being built, before it is actually created.

Returns:
a temporary representation of the table being built.

toSql

String toSql()
Gets a SQL representation of this create table operation. Note that the generated SQL is dialect agnostic, so it is not accurately the same as what will be passed to a potential backing database.

Returns:
a SQL representation of this create table operation.

execute

Table execute()
              throws MetaModelException
Commits the built table and requests that the table structure should be written to the DataContext.

Returns:
the Table that was build
Throws:
MetaModelException - if the DataContext was not able to create the table


Copyright © 2007-2013. All Rights Reserved.