|
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.ERXMigrationColumn
public class ERXMigrationColumn
ERXMigrationColumn is conceptually equivalent to an EOAttribute in the ERXMigrationXxx model. To obtain an ERXMigrationColumn, call ERXMigrationTable.newXxxColumn(..).
| Nested Class Summary | |
|---|---|
static class |
ERXMigrationColumn._ColumnType
Implements EOSchemaSynchronization.ColumnTypes |
| Field Summary | |
|---|---|
static String |
NULL_VALUE_TYPE
|
| Constructor Summary | |
|---|---|
protected |
ERXMigrationColumn(ERXMigrationTable table,
String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue)
Constructs a new ERXMigrationColumn. |
| Method Summary | |
|---|---|
NSArray<EOSQLExpression> |
_createExpressions()
Returns an array of EOSQLExpressions for creating this column. |
NSArray<EOSQLExpression> |
_deleteExpressions()
Returns an array of EOSQLExpressions for deleting this column. |
EOAttribute |
_newAttribute()
Returns an EOAttribute with all of its fields filled in based on the properties of this ERXMigrationColumn. |
EOAttribute |
_newAttribute(EOEntity entity)
Returns an EOAttribute with all of its fields filled in based on the properties of this ERXMigrationColumn. |
NSArray<EOSQLExpression> |
_renameToExpressions(String newName)
Returns an array of EOSQLExpressions for renaming this column. |
void |
_setAllowsNull(boolean allowsNull)
Sets whether or not this column allows nulls. |
void |
_setForeignKeyDestination(ERXMigrationColumn foreignKeyDestination)
Sets the destination column for this foreign key. |
void |
_setName(String name)
Sets the name of this column. |
void |
_setNew(boolean isNew)
Sets whether or not this column has been created in the database. |
void |
_setOverrideExternalType(String overrideExternalType)
Overrides the external type of this column. |
void |
_setOverrideValueType(String overrideValueType)
Sets the value type for the underlying attribute for this column. |
void |
_setPrecision(int precision)
Sets the precision of this column. |
void |
_setPrimaryKey(boolean primaryKey)
Sets whether or not this column is a primary key. |
void |
_setScale(int scale)
Sets the scale of this column. |
void |
_setWidth(int width)
Sets the width of this column. |
boolean |
allowsNull()
Returns the width of this column. |
void |
create()
Executes the SQL operations to create this column. |
Object |
defaultValue()
Returns the default value of this column. |
void |
delete()
Executes the SQL operations to delete this column. |
ERXMigrationColumn |
foreignKeyDestination()
Returns the destination column for this foreign key (note this is only valid if you told migrations the foreign key). |
boolean |
isNew()
Returns true if this column has not yet been created in the database. |
boolean |
isPrimaryKey()
Returns whether or not this column is a primary key (note this is only valid if you told migrations that this column is a primary key). |
String |
name()
Returns the name of this column. |
String |
overrideExternalType()
Returns the external type of this column (or null if there is no override). |
String |
overrideValueType()
Returns the value type associated with the underlying attribute (or null to have this autoselected). |
int |
precision()
Returns the precision of this column. |
void |
renameTo(String newName)
Executes the SQL operations to rename this column. |
int |
scale()
Returns the scale of this column. |
void |
setAllowsNull(boolean allowsNull)
Changes the "allows null" state of this column. |
void |
setDataType(int jdbcType,
int scale,
int precision,
int width,
NSDictionary options)
Changes the data type of this column. |
void |
setDefaultValue(Object defaultValue)
Sets the default value of this column. |
void |
setNumericType(int jdbcType,
int scale,
int precision,
NSDictionary options)
Changes the data type of this column to a new numeric type. |
void |
setWidthType(int jdbcType,
int width,
NSDictionary options)
Changes the data type of this column to a type that has a width. |
ERXMigrationTable |
table()
Returns the parent ERXMigrationTable of this column. |
int |
width()
Returns the width of this column. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NULL_VALUE_TYPE
| Constructor Detail |
|---|
protected ERXMigrationColumn(ERXMigrationTable table,
String name,
int jdbcType,
int width,
int precision,
int scale,
boolean allowsNull,
String overrideValueType,
Object defaultValue)
table - the parent tablename - 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 - this will set the "Default" hint in the EOAttribute's userInfo
dictionary (your plugin must support this)| Method Detail |
|---|
public ERXMigrationTable table()
public void _setName(String name)
name - the name of this columnpublic String name()
public void _setWidth(int width)
width - the width of this columnpublic int width()
public void _setAllowsNull(boolean allowsNull)
allowsNull - if true, this column allows nullspublic boolean allowsNull()
public void _setPrecision(int precision)
precision - the precision of this columnpublic int precision()
public void _setScale(int scale)
scale - the scale of this columnpublic int scale()
public void _setOverrideExternalType(String overrideExternalType)
overrideExternalType - the external type to overridepublic String overrideExternalType()
public void _setOverrideValueType(String overrideValueType)
overrideValueType - the value type for the underlying attribute for this columnpublic String overrideValueType()
public void setDefaultValue(Object defaultValue)
defaultValue - the default value of this columnpublic Object defaultValue()
public void _setPrimaryKey(boolean primaryKey)
primaryKey - whether or not this column is a primary keypublic boolean isPrimaryKey()
public void _setForeignKeyDestination(ERXMigrationColumn foreignKeyDestination)
foreignKeyDestination - the destination column for this foreign keypublic ERXMigrationColumn foreignKeyDestination()
public boolean isNew()
public void _setNew(boolean isNew)
isNew - if true, the column has been createdpublic EOAttribute _newAttribute()
public EOAttribute _newAttribute(EOEntity entity)
entity - the entity to add the attribute to
public NSArray<EOSQLExpression> _createExpressions()
public void create()
throws SQLException
SQLException - if the creation failspublic NSArray<EOSQLExpression> _deleteExpressions()
public void delete()
throws SQLException
SQLException - if the delete failspublic NSArray<EOSQLExpression> _renameToExpressions(String newName)
newName - the new name of this column
public void renameTo(String newName)
throws SQLException
newName - the new name of this column
SQLException - if the rename fails
public void setAllowsNull(boolean allowsNull)
throws SQLException
allowsNull - if true, this column allows nulls
SQLException - if the change fails
public void setDataType(int jdbcType,
int scale,
int precision,
int width,
NSDictionary options)
throws SQLException
jdbcType - the new JDBC type of the column (see java.sql.Types)scale - the new scaleprecision - the new precisionwidth - the new widthoptions - the options to use for conversion (or null)
SQLException - if the change fails
public void setWidthType(int jdbcType,
int width,
NSDictionary options)
throws SQLException
jdbcType - the new JDBC type of the column (see java.sql.Types)width - the new widthoptions - the options to use for conversion (or null)
SQLException - if the change fails
public void setNumericType(int jdbcType,
int scale,
int precision,
NSDictionary options)
throws SQLException
jdbcType - the new JDBC type of the column (see java.sql.Types)scale - the new scaleprecision - the new precisionoptions - the options to use for conversion (or null)
SQLException - if the change fails
|
Last updated: Thu, Jan 8, 2009 12:32 PM EST | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||