public class TableFactory
extends java.lang.Object
Constructor and Description |
---|
TableFactory(Database database) |
Modifier and Type | Method and Description |
---|---|
Column |
addBinary(java.lang.String name,
int size)
Adds a binary
|
Column |
addBlob(java.lang.String name)
Adds a blob
|
void |
addConstraint(Constraint constraint)
Adds a constraint.
|
Column |
addDateTime(java.lang.String name)
Adds a datetime column
|
Column |
addDouble(java.lang.String name)
Adds a double
|
Column |
addIdentity(java.lang.String name)
Adds the identity column
|
Column |
addInteger(java.lang.String name)
Adds an integer
|
Column |
addLong(java.lang.String name)
Adds a long
|
Column |
addNumeric(java.lang.String name,
int precision,
int scale)
Adds a numeric
|
void |
addPrimaryKey(java.util.ArrayList<java.lang.String> names)
Sets the array of columns as the primary key
|
Column |
addShort(java.lang.String name)
Adds a short
|
Column |
addTinytext(java.lang.String name)
Adds a varchar
|
void |
addUnique(java.util.ArrayList<java.lang.String> names)
Sets the array of columns as unique
|
Column |
addVarbinary(java.lang.String name,
int size)
Adds a binary
|
Column |
addVarchar(java.lang.String name,
int size)
Adds a varchar
|
void |
create()
Creates the table.
|
Constraint[] |
getConstraints()
Returns the constraints.
|
java.lang.String |
getName()
Returns the table name.
|
com.caucho.db.table.Row |
getRow()
Returns the row.
|
void |
setAutoIncrement(java.lang.String name,
int min)
Sets the named column as auto-increment
|
void |
setDefault(java.lang.String name,
Expr expr)
Sets the column default
|
void |
setNotNull(java.lang.String name)
Sets the named column as not null
|
void |
setPrimaryKey(java.lang.String name)
Sets the named column as a primary key constraint.
|
void |
setUnique(java.lang.String name)
Sets the named column as unique
|
void |
startTable(java.lang.String name)
Creates a table.
|
public TableFactory(Database database)
public java.lang.String getName()
public com.caucho.db.table.Row getRow()
public void startTable(java.lang.String name)
public Column addTinytext(java.lang.String name)
public Column addVarchar(java.lang.String name, int size)
public Column addVarbinary(java.lang.String name, int size)
public Column addBinary(java.lang.String name, int size)
public Column addBlob(java.lang.String name)
public Column addShort(java.lang.String name)
public Column addInteger(java.lang.String name)
public Column addLong(java.lang.String name)
public Column addIdentity(java.lang.String name)
public Column addDouble(java.lang.String name)
public Column addDateTime(java.lang.String name)
public Column addNumeric(java.lang.String name, int precision, int scale)
public void setPrimaryKey(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public void setNotNull(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public void setDefault(java.lang.String name, Expr expr) throws java.sql.SQLException
java.sql.SQLException
public void setUnique(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public void setAutoIncrement(java.lang.String name, int min) throws java.sql.SQLException
java.sql.SQLException
public void addUnique(java.util.ArrayList<java.lang.String> names) throws java.sql.SQLException
java.sql.SQLException
public void addPrimaryKey(java.util.ArrayList<java.lang.String> names) throws java.sql.SQLException
java.sql.SQLException
public void addConstraint(Constraint constraint)
public Constraint[] getConstraints()
public void create() throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException