ERXMigrationTable Class Reference

Collaboration diagram for ERXMigrationTable:

Collaboration graph
[legend]

List of all members.

Public Member Functions

NSArray< EOSQLExpression > _addForeignKeyExpressions (ERXMigrationColumn sourceColumn, ERXMigrationColumn destinationColumn)
EOEntity _blankEntity ()
void _columnDeleted (ERXMigrationColumn column)
NSArray< EOSQLExpression > _createExpressions ()
NSArray< EOSQLExpression > _dropExpressions ()
NSArray< EOSQLExpression > _dropPrimaryKeyExpressions (ERXMigrationColumn...columns)
ERXMigrationColumn _newColumn (String name, int jdbcType, int width, int precision, int scale, boolean allowsNull, String overrideValueType, Object defaultValue, boolean autocreate) throws SQLException
EOEntity _newEntity ()
EORelationship _newRelationship (ERXMigrationColumn sourceColumn, ERXMigrationColumn destinationColumn)
NSArray< EOSQLExpression > _renameToExpressions (String newName)
void _setName (String name)
void _setNew (boolean isNew)
NSArray< EOSQLExpression > _setPrimaryKeyExpressions (ERXMigrationColumn...columns)
void addForeignKey (boolean create, ERXMigrationColumn sourceColumn, ERXMigrationColumn destinationColumn) throws SQLException
void addForeignKey (ERXMigrationColumn sourceColumn, ERXMigrationColumn destinationColumn) throws SQLException
void addForeignKey (String sourceColumnName, ERXMigrationColumn destinationColumn) throws SQLException
void addForeignKey (String sourceColumnName, String destinationTableName, String destinationColumnName) throws SQLException
void addIndex (boolean create, ERXMigrationIndex index) throws SQLException
void addIndex (ERXMigrationIndex index) throws SQLException
void addIndex (boolean create, String indexName, ERXSQLHelper.ColumnIndex...columnIndexes) throws SQLException
void addIndex (String indexName, ERXSQLHelper.ColumnIndex...columnIndexes) throws SQLException
void addIndex (String indexName, ERXMigrationColumn...columns) throws SQLException
void addIndex (String indexName, String columnName, int width) throws SQLException
void addIndex (String indexName, String columnName) throws SQLException
void addIndex (String columnName) throws SQLException
void addUniqueIndex (boolean create, String indexName, ERXSQLHelper.ColumnIndex...columnIndexes) throws SQLException
void addUniqueIndex (String indexName, ERXSQLHelper.ColumnIndex...columnIndexes) throws SQLException
void addUniqueIndex (String indexName, ERXMigrationColumn...columns) throws SQLException
void addUniqueIndex (String indexName, String columnName, int width) throws SQLException
void addUniqueIndex (String indexName, String columnName) throws SQLException
void addUniqueIndex (String columnName) throws SQLException
void create () throws SQLException
ERXMigrationDatabase database ()
void drop () throws SQLException
void dropPrimaryKey (ERXMigrationColumn...columns) throws SQLException
ERXMigrationColumn existingColumnNamed (String name)
boolean isNew ()
NSArray< Stringlanguages ()
String name ()
ERXMigrationColumn newBigDecimalColumn (String name, int precision, int scale, boolean allowsNull, BigDecimal defaultValue) throws SQLException
ERXMigrationColumn newBigDecimalColumn (String name, int precision, int scale, boolean allowsNull) throws SQLException
ERXMigrationColumn newBigIntegerColumn (String name, boolean allowsNull, Long defaultValue) throws SQLException
ERXMigrationColumn newBigIntegerColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newBlobColumn (String name, int width, boolean allowsNull, NSData defaultValue) throws SQLException
ERXMigrationColumn newBlobColumn (String name, int width, boolean allowsNull) throws SQLException
ERXMigrationColumn newBlobColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newBooleanColumn (String name, boolean allowsNull, Boolean defaultValue) throws SQLException
ERXMigrationColumn newBooleanColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newClobColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newColumn (String name, int jdbcType, int width, int precision, int scale, boolean allowsNull, String overrideValueType) throws SQLException
ERXMigrationColumn newColumn (String name, int jdbcType, int width, int precision, int scale, boolean allowsNull, String overrideValueType, Object defaultValue) throws SQLException
ERXMigrationColumn newDateColumn (String name, boolean allowsNull, NSTimestamp defaultValue) throws SQLException
ERXMigrationColumn newDateColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newDoubleColumn (String name, int precision, int scale, boolean allowsNull, Double defaultValue) throws SQLException
ERXMigrationColumn newDoubleColumn (String name, int precision, int scale, boolean allowsNull) throws SQLException
ERXMigrationColumn newFlagBooleanColumn (String name, boolean allowsNull, Boolean defaultValue) throws SQLException
ERXMigrationColumn newFlagBooleanColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newFloatColumn (String name, int precision, int scale, boolean allowsNull, Float defaultValue) throws SQLException
ERXMigrationColumn newFloatColumn (String name, int precision, int scale, boolean allowsNull) throws SQLException
ERXMigrationColumn newIntBooleanColumn (String name, boolean allowsNull, Boolean defaultValue) throws SQLException
ERXMigrationColumn newIntBooleanColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, int scale, int precision, boolean allowsNull, Object defaultValue) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, int scale, int precision, boolean allowsNull) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, int scale, boolean allowsNull, Integer defaultValue) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, int scale, boolean allowsNull) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, boolean allowsNull, Integer defaultValue) throws SQLException
ERXMigrationColumn newIntegerColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newIpAddressColumn (String name, boolean allowsNull, String defaultValue) throws SQLException
ERXMigrationColumn newIpAddressColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newLargeStringColumn (String name, boolean allowsNull) throws SQLException
NSArray< ERXMigrationColumnnewLocalizedClobColumns (String name, boolean allowsNull) throws SQLException
NSArray< ERXMigrationColumnnewLocalizedStringColumns (String name, int width, boolean allowsNull, String defaultValue) throws SQLException
NSArray< ERXMigrationColumnnewLocalizedStringColumns (String name, int width, boolean allowsNull) throws SQLException
NSDictionary< String, Object > newPrimaryKey ()
NSArray< NSDictionary< String,
Object > > 
newPrimaryKeys (int count)
ERXMigrationColumn newSmallIntegerColumn (String name, boolean allowsNull, Short defaultValue) throws SQLException
ERXMigrationColumn newSmallIntegerColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newStringColumn (String name, boolean allowsNull, String defaultValue) throws SQLException
ERXMigrationColumn newStringColumn (String name, boolean allowsNull) throws SQLException
ERXMigrationColumn newStringColumn (String name, int width, boolean allowsNull, String defaultValue) throws SQLException
ERXMigrationColumn newStringColumn (String name, int width, boolean allowsNull) throws SQLException
ERXMigrationColumn newTimestampColumn (String name, boolean allowsNull, NSTimestamp defaultValue) throws SQLException
ERXMigrationColumn newTimestampColumn (String name, boolean allowsNull) throws SQLException
void renameTo (String newName) throws SQLException
void setPrimaryKey (boolean create, ERXMigrationColumn...columns) throws SQLException
void setPrimaryKey (ERXMigrationColumn...columns) throws SQLException
void setPrimaryKey (String...columnNames) throws SQLException
void setPrimaryKey (String columnName) throws SQLException

Protected Member Functions

 ERXMigrationTable (ERXMigrationDatabase database, String name)

Private Member Functions

ERXSQLHelper.ColumnIndex[] _columnIndexesForMigrationColumns (ERXMigrationColumn...columns)
String _defaultIndexName (boolean unique, String tableName, String...columnNames)
String localizedColumnName (String name, String language)

Private Attributes

NSMutableArray
< ERXMigrationColumn
_columns
ERXMigrationDatabase _database
NSMutableArray< ERXMigrationIndex_indexes
String _name
boolean _new


Detailed Description

ERXMigrationTable provides table-level migration API's. To obtain a table, you should call ERXMigrationDatabase.existingTableNamed or ERXMigrationDatabase.newTableNamed. Note: The .newXxxColumn API's cannot reference prototypes for the same reason that migrations in general cannot reference EOModels.

Author:
mschrag

Constructor & Destructor Documentation

ERXMigrationTable ( ERXMigrationDatabase  database,
String  name 
) [protected]

Constructs an ERXMigrationTable.

Parameters:
database the database this table is within
name the name of this table


Member Function Documentation

NSArray<EOSQLExpression> _addForeignKeyExpressions ( ERXMigrationColumn  sourceColumn,
ERXMigrationColumn  destinationColumn 
)

Returns an array of EOSQLExpressions for adding a foreign key constraint to this table (only supports single attribute FK's right now).

Returns:
an array of EOSQLExpressions for adding a foreign key constraint to this table

EOEntity _blankEntity (  ) 

Returns an EOEntity representing this table with no EOAttributes in it.

Returns:
a shell of an EOEntity for this table

void _columnDeleted ( ERXMigrationColumn  column  ) 

Callback method for ERXMigrationColumn to notify the table that it has been deleted.

Parameters:
column the column that has been deleted

ERXSQLHelper.ColumnIndex [] _columnIndexesForMigrationColumns ( ERXMigrationColumn...  columns  )  [private]

NSArray<EOSQLExpression> _createExpressions (  ) 

Returns an array of EOSQLExpressions for creating this table and all of its ERXMigrationColumns.

Returns:
an array of EOSQLExpressions for creating this table

String _defaultIndexName ( boolean  unique,
String  tableName,
String...  columnNames 
) [private]

NSArray<EOSQLExpression> _dropExpressions (  ) 

Returns an array of EOSQLExpressions for dropping this table.

Returns:
an array of EOSQLExpressions for dropping this table

NSArray<EOSQLExpression> _dropPrimaryKeyExpressions ( ERXMigrationColumn...  columns  ) 

Returns an array of EOSQLExpressions for removing the primary key constraint of this table (only supports single attribute PK's right now).

Parameters:
columns the primary key columns to drop
Returns:
an array of EOSQLExpressions for removing the primary key constraint of this table

ERXMigrationColumn _newColumn ( String  name,
int  jdbcType,
int  width,
int  precision,
int  scale,
boolean  allowsNull,
String  overrideValueType,
Object  defaultValue,
boolean  autocreate 
) throws SQLException

Returns a new ERXMigrationColumn with the given attributes. This method is the most general-purpose of the .newXxx methods. Calling this method will not actually create the column, rather it will only return a metadata wrapper of the attributes you specify. Call .create() on the resulting column object to create the column (or create several columns and then call .create() on this table to create an entire table).

Parameters:
name the name of the column to create
jdbcType the JDBC type of the column (see java.sql.Types)
width the width of the column (or 0 for unspecified)
precision the precision of the column (or 0 for unspecified)
scale the scale of the column (or 0 for unspecified)
allowsNull if true, the column will allow null values
defaultValue the default value for the column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

EOEntity _newEntity (  ) 

Returns an EOEntity representing this table that contains all of the EOAttributes for any ERXMigrationColumn that has been created or retrieved from this table.

Returns:
an EOAttributeful EOEntity for this table

EORelationship _newRelationship ( ERXMigrationColumn  sourceColumn,
ERXMigrationColumn  destinationColumn 
)

Returns a simple single-attribute-mapping EORelationship between two columns. This is called by the foreign key generator.

Parameters:
sourceColumn the source attribute of the relationship
destinationColumn the destination attribute of the relationship
Returns:
the EORelationship that joins the two given columns

NSArray<EOSQLExpression> _renameToExpressions ( String  newName  ) 

Returns an array of EOSQLExpressions for renaming this table.

Returns:
an array of EOSQLExpressions for renaming this table

void _setName ( String  name  ) 

Sets the name of this table. This does not perform a table rename operation.

Parameters:
name the name of this table

void _setNew ( boolean  isNew  ) 

Sets whether or not this table has been created in the database.

Parameters:
isNew if true, the table has been created

NSArray<EOSQLExpression> _setPrimaryKeyExpressions ( ERXMigrationColumn...  columns  ) 

Returns an array of EOSQLExpressions for setting the primary key constraint of this table

Returns:
an array of EOSQLExpressions for setting the primary key constraint of this table

void addForeignKey ( boolean  create,
ERXMigrationColumn  sourceColumn,
ERXMigrationColumn  destinationColumn 
) throws SQLException

Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now).

Parameters:
sourceColumn the source column of the relationship
destinationColumn the destination column of the relationship (should be the PK of the destination table)
Exceptions:
SQLException if the add fails

void addForeignKey ( ERXMigrationColumn  sourceColumn,
ERXMigrationColumn  destinationColumn 
) throws SQLException

Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now).

Parameters:
sourceColumn the source column of the relationship
destinationColumn the destination column of the relationship (should be the PK of the destination table)
Exceptions:
SQLException if the add fails

void addForeignKey ( String  sourceColumnName,
ERXMigrationColumn  destinationColumn 
) throws SQLException

Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now).

Parameters:
sourceColumnName the source column name of the relationship
destinationColumn the destination column of the relationship (should be the PK of the destination table)
Exceptions:
SQLException if the add fails

void addForeignKey ( String  sourceColumnName,
String  destinationTableName,
String  destinationColumnName 
) throws SQLException

Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now).

Parameters:
sourceColumnName the source column name of the relationship
destinationTableName the destination table of the relationship (should be the PK of the destination table)
destinationColumnName the destination column of the relationship (should be the PK of the destination table)
Exceptions:
SQLException if the add fails

void addIndex ( boolean  create,
ERXMigrationIndex  index 
) throws SQLException

Executes the SQL operations to add an index.

Parameters:
create if true, the index is created immediately
index the index to add
Exceptions:
SQLException if the constraint fails

void addIndex ( ERXMigrationIndex  index  )  throws SQLException

Executes the SQL operations to add an index.

Parameters:
index the index to add
Exceptions:
SQLException if the constraint fails

void addIndex ( boolean  create,
String  indexName,
ERXSQLHelper.ColumnIndex...  columnIndexes 
) throws SQLException

Executes the SQL operations to add an index.

Parameters:
create if true, the index is created immediately
indexName the name of the index
columnIndexes the column indexes to unique index on
Exceptions:
SQLException if the constraint fails

void addIndex ( String  indexName,
ERXSQLHelper.ColumnIndex...  columnIndexes 
) throws SQLException

Executes the SQL operations to add an index.

Parameters:
indexName the name of the index
columnIndexes the column indexes to unique index on
Exceptions:
SQLException if the constraint fails

void addIndex ( String  indexName,
ERXMigrationColumn...  columns 
) throws SQLException

Executes the SQL operations to add an index.

Parameters:
indexName the name of the index
columns the columns to add a unique index on
Exceptions:
SQLException if the constraint fails

void addIndex ( String  indexName,
String  columnName,
int  width 
) throws SQLException

Executes the SQL operations to add this index.

Parameters:
indexName the name of the index
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void addIndex ( String  indexName,
String  columnName 
) throws SQLException

Executes the SQL operations to add this index.

Parameters:
indexName the name of the index
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void addIndex ( String  columnName  )  throws SQLException

Executes the SQL operations to add this index.

Parameters:
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( boolean  create,
String  indexName,
ERXSQLHelper.ColumnIndex...  columnIndexes 
) throws SQLException

Executes the SQL operations to add a unique index.

Parameters:
create if true, the index is created immediately
indexName the name of the index
columnIndexes the column indexes to unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( String  indexName,
ERXSQLHelper.ColumnIndex...  columnIndexes 
) throws SQLException

Executes the SQL operations to add a unique index.

Parameters:
indexName the name of the index
columnIndexes the column indexes to unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( String  indexName,
ERXMigrationColumn...  columns 
) throws SQLException

Executes the SQL operations to add a unique index.

Parameters:
indexName the name of the index
columns the columns to add a unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( String  indexName,
String  columnName,
int  width 
) throws SQLException

Executes the SQL operations to add this unique index.

Parameters:
indexName the name of the index
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( String  indexName,
String  columnName 
) throws SQLException

Executes the SQL operations to add this unique index.

Parameters:
indexName the name of the index
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void addUniqueIndex ( String  columnName  )  throws SQLException

Executes the SQL operations to add this unique index.

Parameters:
columnName the name of the column to add a unique index on
Exceptions:
SQLException if the constraint fails

void create (  )  throws SQLException

Executes the SQL operations to create this table.

Exceptions:
SQLException if the creation fails

ERXMigrationDatabase database (  ) 

Returns the ERXMigrationDatabase parent of this table.

Returns:
the ERXMigrationDatabase parent of this table

void drop (  )  throws SQLException

Executes the SQL operations to drop this table.

Exceptions:
SQLException if the drop fails

void dropPrimaryKey ( ERXMigrationColumn...  columns  )  throws SQLException

Executes the SQL operations to drop this primary key constraint (only supports single attribute PK's right now).

Parameters:
columns the primary key columns
Exceptions:
SQLException if the drop fails

ERXMigrationColumn existingColumnNamed ( String  name  ) 

Returns the ERMigrationColumn for the column with the given name. If no column has already been created via a newColumn call, then this will simply return a shell ERXMigrationColumn that should be sufficient for performing drop, rename, and other reference operations.

Parameters:
name the name of the column to retrieve
Returns:
the ERXMigrationColumn for the column name

boolean isNew (  ) 

Returns true if this table has not yet been created in the database.

Returns:
if this table has not yet been created in the database

NSArray<String> languages (  ) 

Returns the configured default languages for this migration.

String localizedColumnName ( String  name,
String  language 
) [private]

String name (  ) 

Returns the name of this table.

Returns:
the name of this table

ERXMigrationColumn newBigDecimalColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull,
BigDecimal  defaultValue 
) throws SQLException

Returns a new BigDecimal column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the BigDecimal
precision the precision of the BigDecimal
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBigDecimalColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull 
) throws SQLException

Returns a new BigDecimal column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the BigDecimal
precision the precision of the BigDecimal
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBigIntegerColumn ( String  name,
boolean  allowsNull,
Long  defaultValue 
) throws SQLException

Returns a new long column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBigIntegerColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new long column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBlobColumn ( String  name,
int  width,
boolean  allowsNull,
NSData  defaultValue 
) throws SQLException

Returns a new Blob column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the width of the blob
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBlobColumn ( String  name,
int  width,
boolean  allowsNull 
) throws SQLException

Returns a new Blob column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the width of the blob
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBlobColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new Blob column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBooleanColumn ( String  name,
boolean  allowsNull,
Boolean  defaultValue 
) throws SQLException

Returns a new varchar(5) boolean column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newBooleanColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new varchar(5) boolean column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newClobColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new string blob column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newColumn ( String  name,
int  jdbcType,
int  width,
int  precision,
int  scale,
boolean  allowsNull,
String  overrideValueType 
) throws SQLException

Returns a new ERXMigrationColumn with the given attributes. This method is the most general-purpose of the .newXxx methods. If this table already exists, calling the .newXxxColumn methods will immediate execute the SQL to add the columns to the table. If this table is new, however, calling .newXxxColumn will only return a metadata object, and you must call .create() on the table.

Parameters:
name the name of the column to create
jdbcType the JDBC type of the column (see java.sql.Types)
width the width of the column (or 0 for unspecified)
precision the precision of the column (or 0 for unspecified)
scale the scale of the column (or 0 for unspecified)
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newColumn ( String  name,
int  jdbcType,
int  width,
int  precision,
int  scale,
boolean  allowsNull,
String  overrideValueType,
Object  defaultValue 
) throws SQLException

Returns a new ERXMigrationColumn with the given attributes. This method is the most general-purpose of the .newXxx methods. If this table already exists, calling the .newXxxColumn methods will immediate execute the SQL to add the columns to the table. If this table is new, however, calling .newXxxColumn will only return a metadata object, and you must call .create() on the table.

Parameters:
name the name of the column to create
jdbcType the JDBC type of the column (see java.sql.Types)
width the width of the column (or 0 for unspecified)
precision the precision of the column (or 0 for unspecified)
scale the scale of the column (or 0 for unspecified)
allowsNull if true, the column will allow null values
defaultValue the default value for the column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newDateColumn ( String  name,
boolean  allowsNull,
NSTimestamp  defaultValue 
) throws SQLException

Returns a new date column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newDateColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new date column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newDoubleColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull,
Double  defaultValue 
) throws SQLException

Returns a new double column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the double
precision the precision of the double
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newDoubleColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull 
) throws SQLException

Returns a new double column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the double
precision the precision of the double
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newFlagBooleanColumn ( String  name,
boolean  allowsNull,
Boolean  defaultValue 
) throws SQLException

Returns a new flag boolean column. See newColumn(..) for the full docs. This might or might not work with your database, it's only tested with PostgreSQL.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newFlagBooleanColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new flag boolean column. See newColumn(..) for the full docs. This might or might not work with your database, it's only tested with PostgreSQL.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newFloatColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull,
Float  defaultValue 
) throws SQLException

Returns a new float column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the float
precision the precision of the float
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newFloatColumn ( String  name,
int  precision,
int  scale,
boolean  allowsNull 
) throws SQLException

Returns a new float column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the float
precision the precision of the float
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntBooleanColumn ( String  name,
boolean  allowsNull,
Boolean  defaultValue 
) throws SQLException

Returns a new integer boolean column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntBooleanColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new integer boolean column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
int  scale,
int  precision,
boolean  allowsNull,
Object  defaultValue 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the integer
precision the precision of the integer
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
int  scale,
int  precision,
boolean  allowsNull 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the integer
precision the precision of the integer
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
int  scale,
boolean  allowsNull,
Integer  defaultValue 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the integer
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
int  scale,
boolean  allowsNull 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
scale the scale of the integer
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
boolean  allowsNull,
Integer  defaultValue 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIntegerColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIpAddressColumn ( String  name,
boolean  allowsNull,
String  defaultValue 
) throws SQLException

Returns a new ipaddress column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newIpAddressColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new ipaddress column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newLargeStringColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new String column (VARCHAR) that corresponds to the varcharLarge prototype. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

NSArray<ERXMigrationColumn> newLocalizedClobColumns ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new localized string blob column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

NSArray<ERXMigrationColumn> newLocalizedStringColumns ( String  name,
int  width,
boolean  allowsNull,
String  defaultValue 
) throws SQLException

Returns a new localized String column (VARCHAR). See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the max width of the varchar
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

NSArray<ERXMigrationColumn> newLocalizedStringColumns ( String  name,
int  width,
boolean  allowsNull 
) throws SQLException

Returns a new localized String column (VARCHAR). See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the max width of the varchar
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

NSDictionary<String, Object> newPrimaryKey (  ) 

Returns a dictionary that represents the primary key for an entity described by this table. Note that you must have specified the primary key columns for this table prior to calling this method via the setPrimaryKeys method (or calling _setPrimaryKey on the individual columns).

Returns:
a dictionary of a primary key

NSArray<NSDictionary<String, Object> > newPrimaryKeys ( int  count  ) 

Returns an array of dictionaries that represent the primary keys for an entity described by this table. Note that you must have specified the primary key columns for this table prior to calling this method via the setPrimaryKeys method (or calling _setPrimaryKey on the individual columns).

Parameters:
count the number of primary keys desired
Returns:
an array of dictionaries of primary keys

ERXMigrationColumn newSmallIntegerColumn ( String  name,
boolean  allowsNull,
Short  defaultValue 
) throws SQLException

Returns a new small integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newSmallIntegerColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new small integer column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newStringColumn ( String  name,
boolean  allowsNull,
String  defaultValue 
) throws SQLException

Returns a new String column (VARCHAR) that corresponds to the varcharLarge prototype. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newStringColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new String column (VARCHAR) with an unbounded length. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newStringColumn ( String  name,
int  width,
boolean  allowsNull,
String  defaultValue 
) throws SQLException

Returns a new String column (VARCHAR). See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the max width of the varchar
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newStringColumn ( String  name,
int  width,
boolean  allowsNull 
) throws SQLException

Returns a new String column (VARCHAR). See newColumn(..) for the full docs.

Parameters:
name the name of the column
width the max width of the varchar
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newTimestampColumn ( String  name,
boolean  allowsNull,
NSTimestamp  defaultValue 
) throws SQLException

Returns a new timestamp column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
defaultValue the default value of this column
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

ERXMigrationColumn newTimestampColumn ( String  name,
boolean  allowsNull 
) throws SQLException

Returns a new timestamp column. See newColumn(..) for the full docs.

Parameters:
name the name of the column
allowsNull if true, the column will allow null values
Returns:
the new ERXMigrationColumn
Exceptions:
SQLException if the column cannot be created

void renameTo ( String  newName  )  throws SQLException

Executes the SQL operations to rename this table.

Exceptions:
SQLException if the rename fails

void setPrimaryKey ( boolean  create,
ERXMigrationColumn...  columns 
) throws SQLException

Executes the SQL operations to add this primary key constraint.

Parameters:
create if create is true, execute this now (vs just flag the ERXMigrationColumn)
columns the primary key columns to designate as primary keys
Exceptions:
SQLException if the constraint fails

void setPrimaryKey ( ERXMigrationColumn...  columns  )  throws SQLException

Executes the SQL operations to add this primary key constraint.

Parameters:
columns the primary key columns to designate as primary keys
Exceptions:
SQLException if the constraint fails

void setPrimaryKey ( String...  columnNames  )  throws SQLException

Executes the SQL operations to add this primary key constraint.

Parameters:
columnNames the names of the columns to set as the primary key
Exceptions:
SQLException if the constraint fails

void setPrimaryKey ( String  columnName  )  throws SQLException

Executes the SQL operations to add this primary key constraint.

Parameters:
columnName the name of the column to set as the primary key
Exceptions:
SQLException if the constraint fails


Member Data Documentation

String _name [private]

boolean _new [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:17 2012 for Project Wonder by  doxygen 1.5.8