com.ptc.windchill.upgrade.directives.mig
Class RenameClassReferencesInColumns

java.lang.Object
  extended bycom.ptc.windchill.upgrade.directives.ForEachClassNameDbColumn
      extended bycom.ptc.windchill.upgrade.directives.mig.RenameClassReferencesInColumns

public final class RenameClassReferencesInColumns
extends ForEachClassNameDbColumn

Changes all references to a particular class to reference another class for each column in the database that may contain a Java class name reference. This will not account for references buried in serialized entries or ones that are stored in other non-standard ways.


Field Summary
private  String newClassName
           
private  String oldClassName
           
 
Fields inherited from class com.ptc.windchill.upgrade.directives.ForEachClassNameDbColumn
 
Constructor Summary
RenameClassReferencesInColumns(String old_class_name, String new_class_name)
          Create an instance to convert the old class name to the new class name.
 
Method Summary
 String getNewClassName()
          The fully qualified class name that should replace the old class name.
 String getOldClassName()
          The fully qualified class name replace with the new class name.
protected  String produceSqlForTableColumn(String table_name, String column_name)
          Called by the superclass...generates an update statement that looks like UPDATE table_name SET column_name='getNewClassName()' where column_name='getOldClassName()'
 
Methods inherited from class com.ptc.windchill.upgrade.directives.ForEachClassNameDbColumn
processAllColumns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

oldClassName

private String oldClassName

newClassName

private String newClassName
Constructor Detail

RenameClassReferencesInColumns

public RenameClassReferencesInColumns(String old_class_name,
                                      String new_class_name)
Create an instance to convert the old class name to the new class name.

Throws:
IllegalArgumentException - if either class name is null
Method Detail

getOldClassName

public final String getOldClassName()
The fully qualified class name replace with the new class name.


getNewClassName

public final String getNewClassName()
The fully qualified class name that should replace the old class name.


produceSqlForTableColumn

protected final String produceSqlForTableColumn(String table_name,
                                                String column_name)
Called by the superclass...generates an update statement that looks like UPDATE table_name SET column_name='getNewClassName()' where column_name='getOldClassName()'

Specified by:
produceSqlForTableColumn in class ForEachClassNameDbColumn
Returns:
must always return a valid, non-null SQL