|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.directives.mig.CopyDataBetweenColumns
Performs the renaming of a column in the database.
>CopyDataBetweenColumns tableName="..." fromColumnName="..." toColumnName="..."/<
Component | Description | Required | Parameterizable |
---|---|---|---|
@tableName | The table to apply the column rename on. | yes | yes, all macros |
@fromColumnName | The name of the column that is being changed. | no | yes, all macros |
@toColumnName | The name to change the column name to. | yes | no |
Field Summary | |
private static String |
FROM_COLUMN_NAME_ATTRIBUTE_NAME
|
private String |
fromColumnName_
|
private static String |
RESOURCE
|
private static String |
TABLE_NAME_ATTRIBUTE_NAME
|
private ParameterizedString |
tableName_
|
private static String |
TO_COLUMN_NAME_ATTRIBUTE_NAME
|
private String |
toColumnName_
|
Constructor Summary | |
CopyDataBetweenColumns()
Create an instance. |
Method Summary | |
void |
asDomOn(Element element)
Writes the directive as a DOM element according to the class documentation above. |
void |
execute(DirectiveServices directive_services)
Parameterizes the table name and executes the column renaming |
private String |
getDirectiveName()
|
String |
getFromColumnName()
The name of the column from which the data is being copied. |
String |
getTableName()
The name of the table to perform the copy on. |
String |
getToColumnName()
The name of the column to copy the data into. |
void |
initializeFromDom(Element element)
Reads the DOM element into this directive according to the class documentation above. |
void |
setFromColumnName(String from_column_name)
Sets the name of the column from which the data is being copied. |
void |
setTableName(String table_name)
Sets the SQL statement. |
void |
setToColumnName(String to_column_name)
Sets the name of the column to copy the data into. |
private void |
validateProperties(String table_name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String TABLE_NAME_ATTRIBUTE_NAME
private static final String FROM_COLUMN_NAME_ATTRIBUTE_NAME
private static final String TO_COLUMN_NAME_ATTRIBUTE_NAME
private ParameterizedString tableName_
private String fromColumnName_
private String toColumnName_
Constructor Detail |
public CopyDataBetweenColumns()
Method Detail |
public void setTableName(String table_name) throws ParseException
ForEachConcreteImplementorOf
.
ParseException
- if the SQL contains a parameterization as allowed in ParameterizedStrings, but it is syntactically incorrect or utilizes a macro incorrectlyForEachConcreteImplementorOf
public void setFromColumnName(String from_column_name)
public void setToColumnName(String to_column_name)
public String getTableName()
public String getFromColumnName()
public String getToColumnName()
public void asDomOn(Element element)
asDomOn
in interface UpdateDirective
public void initializeFromDom(Element element) throws DirectiveIOException
initializeFromDom
in interface UpdateDirective
DirectiveIOException
- if there are syntax errors in parameterization of the statementpublic void execute(DirectiveServices directive_services) throws DirectiveExecutionException
execute
in interface UpdateDirective
DirectiveExecutionException
- if there are parameterization syntax errors, if the connection cannot be acquired, or if there is a SQLExceptionprivate String getDirectiveName()
private void validateProperties(String table_name) throws DirectiveExecutionException
DirectiveExecutionException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |