def METHOD_NAME(self, label, query_count, query, model, get_entity):
    self.start(label)
    total_count = self.connection_source.execute(
        text(query_count)).fetchone()[0]
    print('Total: {0} rows'.format(total_count))
    query = text(query)
    batch = SimpleBatch(
        self.session_target, self.batch_size, model)
    with transaction.manager, batch:
        count = 0
        for entity_in in self.connection_source.execute(query):
            count += 1
            batch.add(get_entity(entity_in))
            self.progress(count, total_count)
        # the transaction will not be commited automatically when doing
        # a bulk insertion. `mark_changed` forces a commit.
        zope.sqlalchemy.mark_changed(self.session_target)
    self.stop()