|
Project Wonder 5.0.0.8794 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecter.extensions.migration.ERXMigrationTable
public class ERXMigrationTable
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.
| Constructor Summary | |
|---|---|
protected |
ERXMigrationTable(ERXMigrationDatabase database,
String name)
Constructs an ERXMigrationTable. |
| Method Summary | |
|---|---|
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). |
EOEntity |
_blankEntity()
Returns an EOEntity representing this table with no EOAttributes in it. |
void |
_columnDeleted(ERXMigrationColumn column)
Callback method for ERXMigrationColumn to notify the table that it has been deleted. |
NSArray<EOSQLExpression> |
_createExpressions()
Returns an array of EOSQLExpressions for creating this table and all of its ERXMigrationColumns. |
NSArray<EOSQLExpression> |
_dropExpressions()
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). |
ERXMigrationColumn |
_newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue,
boolean autocreate)
Returns a new ERXMigrationColumn with the given attributes. |
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. |
EORelationship |
_newRelationship(ERXMigrationColumn sourceColumn,
ERXMigrationColumn destinationColumn)
Returns a simple single-attribute-mapping EORelationship between two columns. |
NSArray<EOSQLExpression> |
_renameToExpressions(String newName)
Returns an array of EOSQLExpressions for renaming this table. |
void |
_setName(String name)
Sets the name of this table. |
void |
_setNew(boolean isNew)
Sets whether or not this table has been created in the database. |
NSArray<EOSQLExpression> |
_setPrimaryKeyExpressions(ERXMigrationColumn... columns)
Returns an array of EOSQLExpressions for setting the primary key constraint of this table |
void |
addForeignKey(boolean create,
ERXMigrationColumn sourceColumn,
ERXMigrationColumn destinationColumn)
Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now). |
void |
addForeignKey(ERXMigrationColumn sourceColumn,
ERXMigrationColumn destinationColumn)
Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now). |
void |
addForeignKey(String sourceColumnName,
ERXMigrationColumn destinationColumn)
Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now). |
void |
addForeignKey(String sourceColumnName,
String destinationTableName,
String destinationColumnName)
Executes the SQL operations to add this foreign key constraint (only supports single attribute FK's right now). |
void |
addIndex(boolean create,
ERXMigrationIndex index)
Executes the SQL operations to add an index. |
void |
addIndex(boolean create,
String indexName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Executes the SQL operations to add an index. |
void |
addIndex(ERXMigrationIndex index)
Executes the SQL operations to add an index. |
void |
addIndex(String columnName)
Executes the SQL operations to add this index. |
void |
addIndex(String indexName,
ERXMigrationColumn... columns)
Executes the SQL operations to add an index. |
void |
addIndex(String indexName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Executes the SQL operations to add an index. |
void |
addIndex(String indexName,
String columnName)
Executes the SQL operations to add this index. |
void |
addIndex(String indexName,
String columnName,
int width)
Executes the SQL operations to add this index. |
void |
addUniqueIndex(boolean create,
String indexName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Executes the SQL operations to add a unique index. |
void |
addUniqueIndex(String columnName)
Executes the SQL operations to add this unique index. |
void |
addUniqueIndex(String indexName,
ERXMigrationColumn... columns)
Executes the SQL operations to add a unique index. |
void |
addUniqueIndex(String indexName,
ERXSQLHelper.ColumnIndex... columnIndexes)
Executes the SQL operations to add a unique index. |
void |
addUniqueIndex(String indexName,
String columnName)
Executes the SQL operations to add this unique index. |
void |
addUniqueIndex(String indexName,
String columnName,
int width)
Executes the SQL operations to add this unique index. |
void |
create()
Executes the SQL operations to create this table. |
ERXMigrationDatabase |
database()
Returns the ERXMigrationDatabase parent of this table. |
void |
drop()
Executes the SQL operations to drop this table. |
void |
dropPrimaryKey(ERXMigrationColumn... columns)
Executes the SQL operations to drop this primary key constraint (only supports single attribute PK's right now). |
ERXMigrationColumn |
existingColumnNamed(String name)
Returns the ERMigrationColumn for the column with the given name. |
boolean |
isNew()
Returns true if this table has not yet been created in the database. |
NSArray<String> |
languages()
Returns the configured default languages for this migration. |
String |
name()
Returns the name of this table. |
ERXMigrationColumn |
newBigDecimalColumn(String name,
int precision,
int scale,
boolean allowsNull)
Returns a new BigDecimal column. |
ERXMigrationColumn |
newBigDecimalColumn(String name,
int precision,
int scale,
boolean allowsNull,
BigDecimal defaultValue)
Returns a new BigDecimal column. |
ERXMigrationColumn |
newBigIntegerColumn(String name,
boolean allowsNull)
Returns a new long column. |
ERXMigrationColumn |
newBigIntegerColumn(String name,
boolean allowsNull,
Long defaultValue)
Returns a new long column. |
ERXMigrationColumn |
newBlobColumn(String name,
boolean allowsNull)
Returns a new Blob column. |
ERXMigrationColumn |
newBlobColumn(String name,
int width,
boolean allowsNull)
Returns a new Blob column. |
ERXMigrationColumn |
newBlobColumn(String name,
int width,
boolean allowsNull,
NSData defaultValue)
Returns a new Blob column. |
ERXMigrationColumn |
newBooleanColumn(String name,
boolean allowsNull)
Returns a new varchar(5) boolean column. |
ERXMigrationColumn |
newBooleanColumn(String name,
boolean allowsNull,
Boolean defaultValue)
Returns a new varchar(5) boolean column. |
ERXMigrationColumn |
newClobColumn(String name,
boolean allowsNull)
Returns a new string blob column. |
ERXMigrationColumn |
newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType)
Returns a new ERXMigrationColumn with the given attributes. |
ERXMigrationColumn |
newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue)
Returns a new ERXMigrationColumn with the given attributes. |
ERXMigrationColumn |
newFlagBooleanColumn(String name,
boolean allowsNull)
Returns a new flag boolean column. |
ERXMigrationColumn |
newFloatColumn(String name,
int precision,
int scale,
boolean allowsNull)
Returns a new float column. |
ERXMigrationColumn |
newFloatColumn(String name,
int precision,
int scale,
boolean allowsNull,
Float defaultValue)
Returns a new float column. |
ERXMigrationColumn |
newIntBooleanColumn(String name,
boolean allowsNull)
Returns a new integer boolean column. |
ERXMigrationColumn |
newIntBooleanColumn(String name,
boolean allowsNull,
Boolean defaultValue)
Returns a new integer boolean column. |
ERXMigrationColumn |
newIntegerColumn(String name,
boolean allowsNull)
Returns a new integer column. |
ERXMigrationColumn |
newIntegerColumn(String name,
boolean allowsNull,
Integer defaultValue)
Returns a new integer column. |
ERXMigrationColumn |
newIntegerColumn(String name,
int scale,
boolean allowsNull)
Returns a new integer column. |
ERXMigrationColumn |
newIntegerColumn(String name,
int scale,
boolean allowsNull,
Integer defaultValue)
Returns a new integer column. |
ERXMigrationColumn |
newIntegerColumn(String name,
int scale,
int precision,
boolean allowsNull)
Returns a new integer column. |
ERXMigrationColumn |
newIntegerColumn(String name,
int scale,
int precision,
boolean allowsNull,
Object defaultValue)
Returns a new integer column. |
ERXMigrationColumn |
newIpAddressColumn(String name,
boolean allowsNull)
Returns a new ipaddress column. |
ERXMigrationColumn |
newIpAddressColumn(String name,
boolean allowsNull,
String defaultValue)
Returns a new ipaddress column. |
ERXMigrationColumn |
newLargeStringColumn(String name,
boolean allowsNull)
Returns a new String column (VARCHAR) that corresponds to the varcharLarge prototype. |
NSArray<ERXMigrationColumn> |
newLocalizedClobColumns(String name,
boolean allowsNull)
Returns a new localized string blob column. |
NSArray<ERXMigrationColumn> |
newLocalizedStringColumns(String name,
int width,
boolean allowsNull)
Returns a new localized String column (VARCHAR). |
NSArray<ERXMigrationColumn> |
newLocalizedStringColumns(String name,
int width,
boolean allowsNull,
String defaultValue)
Returns a new localized String column (VARCHAR). |
NSDictionary<String,Object> |
newPrimaryKey()
Returns a dictionary that represents the primary key for an entity described by this table. |
NSArray<NSDictionary<String,Object>> |
newPrimaryKeys(int count)
Returns an array of dictionaries that represent the primary keys for an entity described by this table. |
ERXMigrationColumn |
newStringColumn(String name,
boolean allowsNull,
String defaultValue)
Returns a new String column (VARCHAR) that corresponds to the varcharLarge prototype. |
ERXMigrationColumn |
newStringColumn(String name,
int width,
boolean allowsNull)
Returns a new String column (VARCHAR). |
ERXMigrationColumn |
newStringColumn(String name,
int width,
boolean allowsNull,
String defaultValue)
Returns a new String column (VARCHAR). |
ERXMigrationColumn |
newTimestampColumn(String name,
boolean allowsNull)
Returns a new timestamp column. |
ERXMigrationColumn |
newTimestampColumn(String name,
boolean allowsNull,
NSTimestamp defaultValue)
Returns a new timestamp column. |
void |
renameTo(String newName)
Executes the SQL operations to rename this table. |
void |
setPrimaryKey(boolean create,
ERXMigrationColumn... columns)
Executes the SQL operations to add this primary key constraint. |
void |
setPrimaryKey(ERXMigrationColumn... columns)
Executes the SQL operations to add this primary key constraint. |
void |
setPrimaryKey(String... columnNames)
Executes the SQL operations to add this primary key constraint. |
void |
setPrimaryKey(String columnName)
Executes the SQL operations to add this primary key constraint. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ERXMigrationTable(ERXMigrationDatabase database,
String name)
database - the database this table is withinname - the name of this table| Method Detail |
|---|
public ERXMigrationDatabase database()
public NSArray<String> languages()
public void _setName(String name)
name - the name of this tablepublic String name()
public boolean isNew()
public void _setNew(boolean isNew)
isNew - if true, the table has been createdpublic EOEntity _blankEntity()
public EOEntity _newEntity()
public ERXMigrationColumn existingColumnNamed(String name)
name - the name of the column to retrieve
public EORelationship _newRelationship(ERXMigrationColumn sourceColumn,
ERXMigrationColumn destinationColumn)
sourceColumn - the source attribute of the relationshipdestinationColumn - the destination attribute of the relationship
public ERXMigrationColumn _newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue,
boolean autocreate)
throws SQLException
name - the name of the column to createjdbcType - 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 valuesdefaultValue - the default value for the column
SQLException - if the column cannot be created
public ERXMigrationColumn newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue)
throws SQLException
name - the name of the column to createjdbcType - 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 valuesdefaultValue - the default value for the column
SQLException - if the column cannot be created
public ERXMigrationColumn newColumn(String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType)
throws SQLException
name - the name of the column to createjdbcType - 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
SQLException - if the column cannot be created
public ERXMigrationColumn newStringColumn(String name,
int width,
boolean allowsNull)
throws SQLException
name - the name of the columnwidth - the max width of the varcharallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newStringColumn(String name,
int width,
boolean allowsNull,
String defaultValue)
throws SQLException
name - the name of the columnwidth - the max width of the varcharallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newLargeStringColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newStringColumn(String name,
boolean allowsNull,
String defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public NSArray<ERXMigrationColumn> newLocalizedStringColumns(String name,
int width,
boolean allowsNull)
throws SQLException
name - the name of the columnwidth - the max width of the varcharallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public NSArray<ERXMigrationColumn> newLocalizedStringColumns(String name,
int width,
boolean allowsNull,
String defaultValue)
throws SQLException
name - the name of the columnwidth - the max width of the varcharallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public NSArray<ERXMigrationColumn> newLocalizedClobColumns(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
boolean allowsNull,
Integer defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
int scale,
boolean allowsNull)
throws SQLException
name - the name of the columnscale - the scale of the integerallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
int scale,
boolean allowsNull,
Integer defaultValue)
throws SQLException
name - the name of the columnscale - the scale of the integerallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
int scale,
int precision,
boolean allowsNull)
throws SQLException
name - the name of the columnscale - the scale of the integerprecision - the precision of the integerallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIntegerColumn(String name,
int scale,
int precision,
boolean allowsNull,
Object defaultValue)
throws SQLException
name - the name of the columnscale - the scale of the integerprecision - the precision of the integerallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newBigIntegerColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBigIntegerColumn(String name,
boolean allowsNull,
Long defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newFloatColumn(String name,
int precision,
int scale,
boolean allowsNull)
throws SQLException
name - the name of the columnscale - the scale of the floatprecision - the precision of the floatallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newFloatColumn(String name,
int precision,
int scale,
boolean allowsNull,
Float defaultValue)
throws SQLException
name - the name of the columnscale - the scale of the floatprecision - the precision of the floatallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newBigDecimalColumn(String name,
int precision,
int scale,
boolean allowsNull)
throws SQLException
name - the name of the columnscale - the scale of the BigDecimalprecision - the precision of the BigDecimalallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBigDecimalColumn(String name,
int precision,
int scale,
boolean allowsNull,
BigDecimal defaultValue)
throws SQLException
name - the name of the columnscale - the scale of the BigDecimalprecision - the precision of the BigDecimalallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newBooleanColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBooleanColumn(String name,
boolean allowsNull,
Boolean defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newIntBooleanColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIntBooleanColumn(String name,
boolean allowsNull,
Boolean defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newFlagBooleanColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newClobColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBlobColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBlobColumn(String name,
int width,
boolean allowsNull)
throws SQLException
name - the name of the columnwidth - the width of the bloballowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newBlobColumn(String name,
int width,
boolean allowsNull,
NSData defaultValue)
throws SQLException
name - the name of the columnwidth - the width of the bloballowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newTimestampColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newTimestampColumn(String name,
boolean allowsNull,
NSTimestamp defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be created
public ERXMigrationColumn newIpAddressColumn(String name,
boolean allowsNull)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null values
SQLException - if the column cannot be created
public ERXMigrationColumn newIpAddressColumn(String name,
boolean allowsNull,
String defaultValue)
throws SQLException
name - the name of the columnallowsNull - if true, the column will allow null valuesdefaultValue - the default value of this column
SQLException - if the column cannot be createdpublic void _columnDeleted(ERXMigrationColumn column)
column - the column that has been deletedpublic NSArray<EOSQLExpression> _createExpressions()
public void create()
throws SQLException
SQLException - if the creation failspublic NSArray<EOSQLExpression