int fields = oldRowDef.getFieldCount();
// Find the PK and FK fields
BitSet keyField = new BitSet(fields);
TableIndex pkIndex = oldRowDef.getPKIndex();
int nkeys = pkIndex.getKeyColumns().size();
IndexRowComposition indexRowComposition = pkIndex.indexRowComposition();
for (int i = 0; i < nkeys; i++) {
int pkFieldPosition = indexRowComposition.getFieldPosition(i);
keyField.set(pkFieldPosition, true);
}
for (int fkFieldPosition : oldRowDef.getParentJoinFields()) {