org.eobjects.metamodel.create
Class AbstractTableCreationBuilder<U extends UpdateCallback>

java.lang.Object
  extended by org.eobjects.metamodel.create.AbstractTableCreationBuilder<U>
All Implemented Interfaces:
TableCreationBuilder

public abstract class AbstractTableCreationBuilder<U extends UpdateCallback>
extends Object
implements TableCreationBuilder

Abstract TableCreationBuilder implementation, provided as convenience for TableCreatable implementations. Handles all the building operations, but not the commit operation.

Author:
Kasper Sørensen

Constructor Summary
AbstractTableCreationBuilder(U updateCallback, Schema schema, String name)
           
 
Method Summary
protected  Schema getSchema()
           
protected  MutableTable getTable()
           
protected  U getUpdateCallback()
           
 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.
 String toString()
           
 Table toTable()
          Returns this builder instance as a table.
 ColumnCreationBuilder withColumn(String name)
          Adds a column to the current builder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.create.TableCreationBuilder
execute
 

Constructor Detail

AbstractTableCreationBuilder

public AbstractTableCreationBuilder(U updateCallback,
                                    Schema schema,
                                    String name)
Method Detail

getUpdateCallback

protected U getUpdateCallback()

getSchema

protected Schema getSchema()

getTable

protected MutableTable getTable()

toTable

public Table toTable()
Description copied from interface: TableCreationBuilder
Returns this builder instance as a table. This allows for inspecting the table that is being built, before it is actually created.

Specified by:
toTable in interface TableCreationBuilder
Returns:
a temporary representation of the table being built.

like

public TableCreationBuilder like(Table table)
Description copied from interface: TableCreationBuilder
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.

Specified by:
like in interface TableCreationBuilder
Parameters:
table - the Table to use as a prototype
Returns:
a builder object for further table creation

withColumn

public ColumnCreationBuilder withColumn(String name)
Description copied from interface: TableCreationBuilder
Adds a column to the current builder

Specified by:
withColumn in interface TableCreationBuilder
Returns:

toString

public String toString()
Overrides:
toString in class Object

toSql

public String toSql()
Description copied from interface: TableCreationBuilder
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.

Specified by:
toSql in interface TableCreationBuilder
Returns:
a SQL representation of this create table operation.


Copyright © 2007-2013. All Rights Reserved.