def migrate_valid_references(row, migrated)
      # Split the valid and invalid objects. The iteration is in reverse dependency order,
      # since invalidating a dependent can invalidate the owner.
      ordered = migrated.transitive_closure(:dependents)
      ordered.keep_if { |obj| migrated.include?(obj) }.reverse!
      valid, invalid = ordered.partition do |obj|
        if migration_valid?(obj) then
          obj.migrate_references(row, migrated, @target_class, @attr_flt_hash[obj.class])
          true
        else
          obj.class.owner_attributes.each { |pa| obj.clear_attribute(pa) }
          false
        end
      end
      
      # Go back through the valid objects in dependency order to invalidate dependents
      # whose owner is invalid.
      valid.reverse.each do |obj|
        unless owner_valid?(obj, valid, invalid) then
          invalid << valid.delete(obj)
          logger.debug { "The migrator invalidated #{obj} since it does not have a valid owner." }
        end
      end
      
      # Go back through the valid objects in reverse dependency order to invalidate owners
      # created only to hold a dependent which was subsequently invalidated.
      valid.reject do |obj|
        if @owners.include?(obj.class) and obj.dependents.all? { |dep| invalid.include?(dep) } then
          # clear all references from the invalidated owner
          obj.class.domain_attributes.each { |pa| obj.clear_attribute(pa) }
          invalid << obj
          logger.debug { "The migrator invalidated #{obj.qp} since it was created solely to hold subsequently invalidated dependents." }
          true
        end
      end
    end
def migrate_valid_references(row, migrated)
      # Split the valid and invalid objects. The iteration is in reverse dependency order,
      # since invalidating a dependent can invalidate the owner.
      ordered = migrated.transitive_closure(:dependents)
      ordered.keep_if { |obj| migrated.include?(obj) }.reverse!
      valid, invalid = ordered.partition do |obj|
        if migration_valid?(obj) then
          obj.migrate_references(row, migrated, @target_class, @attr_flt_hash[obj.class])
          true
        else
          obj.class.owner_attributes.each { |pa| obj.clear_attribute(pa) }
          false
        end
      end
      
      # Go back through the valid objects in dependency order to invalidate dependents
      # whose owner is invalid.
      valid.reverse.each do |obj|
        unless owner_valid?(obj, valid, invalid) then
          invalid << valid.delete(obj)
          logger.debug { "The migrator invalidated #{obj} since it does not have a valid owner." }
        end
      end
      
      # Go back through the valid objects in reverse dependency order to invalidate owners
      # created only to hold a dependent which was subsequently invalidated.
      valid.reject do |obj|
        if @owners.include?(obj.class) and obj.dependents.all? { |dep| invalid.include?(dep) } then
          # clear all references from the invalidated owner
          obj.class.domain_attributes.each { |pa| obj.clear_attribute(pa) }
          invalid << obj
          logger.debug { "The migrator invalidated #{obj.qp} since it was created solely to hold subsequently invalidated dependents." }
          true
        end
      end
    end
Sets the migration references for each valid migrated object.

 @param row (see #migrate_row)
 @param [Array] migrated the migrated objects
 @return [Array] the valid migrated objects