|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgpruitt.datamodeler.core.TableBuilder
public class TableBuilder
A Fluent Builder class for constructing Table objects
Nested Class Summary | |
---|---|
class |
TableBuilder.ForeignKeyBuilder
A Fluent Builder class for constructing ForeignKey constraints |
Field Summary | |
---|---|
protected SchemaBuilder |
schemaBuilder
|
protected Table |
table
|
Constructor Summary | |
---|---|
protected |
TableBuilder(java.lang.String name,
SchemaBuilder schemaBuilder)
Constructor |
Method Summary | |
---|---|
ColumnBuilder |
column(java.lang.String name)
Adds a Column to the Table |
TableBuilder |
comment(java.lang.String comment)
Sets the comment describing the Table |
SchemaBuilder |
done()
Gets the SchemaBuilder |
TableBuilder.ForeignKeyBuilder |
foreignKey(java.lang.String name)
Creates a ForeignKey constraint on the Table. |
IndexBuilder |
index(java.lang.String name)
Creates an Index on Columns of the Table |
TableBuilder |
primaryKey(java.lang.String name,
java.lang.String... columns)
Creates a PrimaryKey constraint on the Table |
TableBuilder |
uniqueKey(java.lang.String name,
java.lang.String... columns)
Creates a UniqueKey constraint on Columns of the Table |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Table table
protected final SchemaBuilder schemaBuilder
Constructor Detail |
---|
protected TableBuilder(java.lang.String name, SchemaBuilder schemaBuilder)
name
- the name of the new Table to createschemaBuilder
- the SchemaBuilder of the Schema to which the Table should be addedMethod Detail |
---|
public SchemaBuilder done()
public TableBuilder comment(java.lang.String comment)
comment
- the comment
public ColumnBuilder column(java.lang.String name)
name
- the name of the Column
public TableBuilder primaryKey(java.lang.String name, java.lang.String... columns)
name
- the name of the PrimaryKey constraintcolumns
- the names of the Columns in the Table that make up the primary key
public TableBuilder uniqueKey(java.lang.String name, java.lang.String... columns)
name
- the name of the UniqueKey constraintcolumns
- the names of the Columns that make up the unique key constraint
public TableBuilder.ForeignKeyBuilder foreignKey(java.lang.String name)
name
- the name of the ForeignKey to create
public IndexBuilder index(java.lang.String name)
name
- the name of the Index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |