org.eobjects.metamodel.create
Class CreateTableColumnBuilder

java.lang.Object
  extended by org.eobjects.metamodel.create.CreateTableColumnBuilder
All Implemented Interfaces:
ColumnBuilder<CreateTableColumnBuilder>, UpdateScript, Action<UpdateCallback>

public final class CreateTableColumnBuilder
extends Object
implements ColumnBuilder<CreateTableColumnBuilder>, UpdateScript

Column builder for CreateTable.


Constructor Summary
CreateTableColumnBuilder(CreateTable createTable, MutableColumn column)
           
 
Method Summary
 T asPrimaryKey()
          Defines that the created column should be a primary key
protected  MutableColumn getColumn()
           
protected  T getReturnObject()
           
 T like(Column column)
          Builds several properties of a column, based on another Column object as a prototype.
 T nullable(boolean nullable)
          Defines if the created column should be nullable or not.
 T ofNativeType(String nativeType)
          Defines the native type of the created column (useful especially for SQL based DataContexts).
 T ofSize(int size)
          Defines the size of the created column.
 T ofType(ColumnType type)
          Defines the ColumnType of the created column.
 void run(UpdateCallback callback)
          Invoked by MetaModel when the update script should be run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eobjects.metamodel.create.ColumnBuilder
asPrimaryKey, like, nullable, ofNativeType, ofSize, ofType
 

Constructor Detail

CreateTableColumnBuilder

public CreateTableColumnBuilder(CreateTable createTable,
                                MutableColumn column)
Method Detail

run

public void run(UpdateCallback callback)
Description copied from interface: UpdateScript
Invoked by MetaModel when the update script should be run. User should implement this method and invoke update operations on the UpdateCallback.

Specified by:
run in interface UpdateScript
Specified by:
run in interface Action<UpdateCallback>

getColumn

protected MutableColumn getColumn()

getReturnObject

protected T getReturnObject()

like

public final T like(Column column)
Description copied from interface: ColumnBuilder
Builds several properties of a column, based on another Column object as a prototype.

Specified by:
like in interface ColumnBuilder<T extends ColumnBuilder<?>>
Parameters:
column - a prototype for the column being built.
Returns:
a builder object for further column creation.

ofType

public final T ofType(ColumnType type)
Description copied from interface: ColumnBuilder
Defines the ColumnType of the created column.

Specified by:
ofType in interface ColumnBuilder<T extends ColumnBuilder<?>>
Parameters:
type - the column type of the created column.
Returns:
a builder object for further column creation.

ofNativeType

public final T ofNativeType(String nativeType)
Description copied from interface: ColumnBuilder
Defines the native type of the created column (useful especially for SQL based DataContexts).

Specified by:
ofNativeType in interface ColumnBuilder<T extends ColumnBuilder<?>>
Parameters:
nativeType - the native type of the created column
Returns:
a builder object for further column creation.

ofSize

public final T ofSize(int size)
Description copied from interface: ColumnBuilder
Defines the size of the created column.

Specified by:
ofSize in interface ColumnBuilder<T extends ColumnBuilder<?>>
Parameters:
size - the size of the created column.
Returns:
a builder object for further column creation.

nullable

public final T nullable(boolean nullable)
Description copied from interface: ColumnBuilder
Defines if the created column should be nullable or not.

Specified by:
nullable in interface ColumnBuilder<T extends ColumnBuilder<?>>
Parameters:
nullable - if the created column should be nullable or not.
Returns:
a builder object for further column creation.

asPrimaryKey

public final T asPrimaryKey()
Description copied from interface: ColumnBuilder
Defines that the created column should be a primary key

Specified by:
asPrimaryKey in interface ColumnBuilder<T extends ColumnBuilder<?>>
Returns:
a builder object for further column creation.


Copyright © 2007-2013. All Rights Reserved.