|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.windchill.upgrade.directives.postmigschemaupgrade.ModifyColumnNotNull
Alters a table to redeclare a column as not null if it is not already. The directive will not produce an error for columns that are already declared NOT NULL.
>ModifyColumnNotNull tableName="..." columnName="..."/<
Component | Description | Required | Parameterizable |
---|---|---|---|
Attribute tableName |
The table to alter. | yes | yes, {Class} |
Attribute tableName |
The column to modify. | yes | yes, {ColumnDescriptor:...} |
>ModifyColumnNotNull tableName="SomeExistingTable" columnName="IDA3D2"/<
Field Summary | |
static String |
COLUMN_NAME_ATTRIBUTE_NAME
|
private ParameterizedString |
columnName_
|
private static String |
findObjectsDependentUponTable__
|
static String |
TABLE_NAME_ATTRIBUTE_NAME
|
private ParameterizedString |
tableName_
|
Constructor Summary | |
ModifyColumnNotNull()
Create an instance with empty table name and column name. |
Method Summary | |
void |
asDomOn(Element element)
Writes the attributes as described in the class documentation above. |
void |
execute(DirectiveServices directive_services)
|
private static boolean |
executeSqlUpdate(String sql,
Connection connection)
Execute the update statement, but do not report any ORA-01442 errors. |
private String |
getDirectiveName()
|
void |
initializeFromDom(Element element)
Reads from DOMs formatted as described in the class documentation above. |
private static void |
recompileDependentObjects(String table_name,
Connection connection)
|
void |
setColumnName(String column_name)
Sets the column name to alter. |
static void |
setNullability(Connection connection,
String table_name,
String column_name,
boolean nullable)
Change the column constraint on a table's column to NULL or NOT NULL based on the value of the nullable parameter. |
void |
setTableName(String table_name)
Sets the table name to alter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String TABLE_NAME_ATTRIBUTE_NAME
public static final String COLUMN_NAME_ATTRIBUTE_NAME
private static String findObjectsDependentUponTable__
private ParameterizedString tableName_
private ParameterizedString columnName_
Constructor Detail |
public ModifyColumnNotNull()
Method Detail |
public void setTableName(String table_name) throws ParseException
ForEachConcreteImplementorOf
.
ParseException
- if the table name contains a parameterization as allowed in ParameterizedStrings, but it is syntactically incorrect or utilizes a macro incorrectlyForEachConcreteImplementorOf
public void setColumnName(String column_name) throws ParseException
ForEachConcreteImplementorOf
.
ParseException
- if the table name contains a parameterization as allowed in ParameterizedStrings, but it is syntactically incorrect or utilizes a macro incorrectlyForEachConcreteImplementorOf
public void asDomOn(Element element)
asDomOn
in interface UpdateDirective
public void initializeFromDom(Element element) throws DirectiveIOException
initializeFromDom
in interface UpdateDirective
DirectiveIOException
- if one(or both) of the attributes is missing or if it is written as a parameterized attribute and contains a syntax errorpublic void execute(DirectiveServices directive_services) throws DirectiveExecutionException
execute
in interface UpdateDirective
DirectiveExecutionException
public static void setNullability(Connection connection, String table_name, String column_name, boolean nullable) throws DirectiveExecutionException
This is a generic, reusable static method that is used by this directivec but which can also be used by other code, provided that they supply the JDBC connection.
DirectiveExecutionException
private static void recompileDependentObjects(String table_name, Connection connection) throws DirectiveExecutionException
DirectiveExecutionException
private static boolean executeSqlUpdate(String sql, Connection connection) throws DirectiveExecutionException
DirectiveExecutionException
- for all other ora errorsprivate String getDirectiveName()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |