}
}
// sanity check
if (oldNames.size() != nuNames.size())
{
throw new IntegrityException("The number of properties has changed, use updateSchema(...) instead.");
}
// iterate over the old names, find matching new name
for (int oldIndex = 0; oldIndex < oldNames.size(); oldIndex++)
{
String oldType = oldTypes.get(oldIndex);
int nuIndex = nuTypes.indexOf(oldType);
// make sure there is only one column of this type in both old
// and new version of object
if (oldTypes.indexOf(oldType) != oldTypes.lastIndexOf(oldType)
|| nuIndex != nuTypes.lastIndexOf(oldType))
{
throw new IntegrityException("More than one changed property of type " + oldType + " in table "
+ tableName);
}
// execute schema update
renameColumn(tableName, oldNames.get(oldIndex), nuNames.get(nuIndex), cw);
}