com.mysema.query.sql.ddl
Class CreateTableClause

java.lang.Object
  extended by com.mysema.query.sql.ddl.CreateTableClause

public class CreateTableClause
extends Object

CreateTableClause defines a CREATE TABLE clause

Author:
tiwe

Constructor Summary
CreateTableClause(Connection conn, SQLTemplates templates, String table)
           
 
Method Summary
 CreateTableClause autoIncrement()
          Set the last column to auto increment
 CreateTableClause column(String name, Class<?> type)
          Add a new column definition
 void execute()
          Execute the clause
 ForeignKeyBuilder foreignKey(String name, String... columns)
          Add a foreign key
 CreateTableClause index(String name, String... columns)
          Add an index
 CreateTableClause notNull()
          Set the last added column to not null
 CreateTableClause primaryKey(String name, String... columns)
          Set the primary key
 CreateTableClause size(int size)
          Set the size of the last column's type
 CreateTableClause unique()
          Set the last added index to unique
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateTableClause

public CreateTableClause(Connection conn,
                         SQLTemplates templates,
                         String table)
Method Detail

column

public CreateTableClause column(String name,
                                Class<?> type)
Add a new column definition

Parameters:
name -
type -
Returns:

notNull

public CreateTableClause notNull()
Set the last added column to not null

Returns:

size

public CreateTableClause size(int size)
Set the size of the last column's type

Parameters:
size -
Returns:

autoIncrement

public CreateTableClause autoIncrement()
Set the last column to auto increment

Returns:

primaryKey

public CreateTableClause primaryKey(String name,
                                    String... columns)
Set the primary key

Parameters:
name -
columns -
Returns:

index

public CreateTableClause index(String name,
                               String... columns)
Add an index

Parameters:
name -
columns -
Returns:

unique

public CreateTableClause unique()
Set the last added index to unique

Returns:

foreignKey

public ForeignKeyBuilder foreignKey(String name,
                                    String... columns)
Add a foreign key

Parameters:
name -
columns -
Returns:

execute

public void execute()
Execute the clause



Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.