Add the current state of bindings as a batch item

@return the current object
762901
@WithBridgeMethods(value = SQLUpdateClause.class, castRequired = true)
    public C addBatch() {
        batches.add(new SQLUpdateBatch(metadata, updates));
        updates = Maps.newLinkedHashMap();
        metadata = new DefaultQueryMetadata();
        metadata.addJoin(JoinType.DEFAULT, entity);
        return (C) this;
    }
995755
public UNode toDoc() {
        // Root node is map with 1 child per result field and optionally "docs".
        UNode result = UNode.createMapNode("batch-result");
        for (String fieldName : m_resultFields.keySet()) {
            result.addValueNode(fieldName, m_resultFields.get(fieldName));
        }
        if (m_objResultList.size() > 0) {
            UNode docsNode = result.addArrayNode("docs");
            for (ObjectResult objResult : m_objResultList) {
                docsNode.addChildNode(objResult.toDoc());
            }
        }
        return result;
    }
1951
private void batchImport() {
        m_jdbcTemplate.batchUpdate(createInsertQuery(),
                                   new BatchPreparedStatementSetter() {
                                       public void setValues(
                                               PreparedStatement ps, int i)
                                               throws SQLException {
                                           int j = 1;
                                           for (String property : m_propertyNames) {
                                               Map params = (Map) m_batch.get(
                                                       i);
                                               ps.setObject(j++, params.get(
                                                       property));
                                           }
                                       }

                                       public int getBatchSize() {
                                           return m_batch.size();
                                       }
                                   });
    }
126824
function() {
            this.options.route = 'todo';
            this.options.collection = new TodoList(todos.remaining());
            this.options.toggleItem = _.bind(this.toggleItem, this);
            this.options.addItem = _.bind(this.addItem, this);
            this.options.refreshModel = _.bind(this.refreshModel, this);
        }
989398
def current(self):
        
        if self.obj is not None:
            return {name: mstate(self.obj, self.cls)
                for name, mstate in self.statemanager.states.items()
                if mstate(self.obj, self.cls)}
55426
function batchData(map) {
    var cy = this;
    return this.batch(function () {
      var ids = Object.keys(map);

      for (var i = 0; i < ids.length; i++) {
        var id = ids[i];
        var data = map[id];
        var ele = cy.getElementById(id);
        ele.data(data);
      }
    });
  }
364773
function(){
    this.isRendered = true;
    this.isClosed = false;
    this.resetItemViewContainer();

    this.triggerBeforeRender();
    var html = this.renderModel();
    this.$el.html(html);
    // the ui bindings is done here and not at the end of render since they
    // will not be available until after the model is rendered, but should be
    // available before the collection is rendered.
    this.bindUIElements();
    this.triggerMethod("composite:model:rendered");

    this._renderChildren();

    this.triggerMethod("composite:rendered");
    this.triggerRendered();
    return this;
  }
915926
public function unbindAllModels() {
        foreach ($this->getBindings() as $alias => $binding) {
            $this->unbindModel($alias);
        }
        return $this;
    }
1149585
public BatchResult addBatch(ApplicationDefinition appDef, String shardName, OlapBatch batch) {
        Utils.require(shardName.equals(MONO_SHARD_NAME), "Shard name must be: " + MONO_SHARD_NAME);
        return OLAPService.instance().addBatch(appDef, shardName, batch);
    }
1076370
public QuadBatch pushBatch (QuadBatch newBatch) {
    if (newBatch == null) return null;
    QuadBatch oldBatch = batch;
    batch.end();
    batch = beginBatch(newBatch);
    return oldBatch;
  }
624442
private void bindButtonEnabling() {
        final BooleanBinding bexpr = new BooleanBinding() {

            @Override
            protected boolean computeValue() {
                return !(object().sourcePath() != null && object().sourcePath().exists() && object().sourcePath().isDirectory()
                        && object().targetPath() != null && object().targetPath().exists() && object().targetPath().isDirectory());
            }
        };

        final ChangeListener<File> cl = new ChangeListener<File>() {

            @Override
            public void changed(final ObservableValue<? extends File> observable, final File oldValue, final File newValue) {
                bexpr.invalidate();
            }
        };

        object().pSourcePath().addListener(cl);
        object().pTargetPath().addListener(cl);

        view().getStartButton().disableProperty().bind(bexpr);

        final SimpleListProperty<FileComparison> filteredListProperty = new SimpleListProperty<>(view().getTable().getItems());
        view().getExportCSV().disableProperty().bind(filteredListProperty.emptyProperty());

        final SimpleListProperty<FileComparison> listProperty = new SimpleListProperty<>(object().pLastResult());
        view().getMissing().disableProperty().bind(listProperty.emptyProperty());
        view().getDowngraded().disableProperty().bind(listProperty.emptyProperty());
        view().getNewer().disableProperty().bind(listProperty.emptyProperty());
        view().getSame().disableProperty().bind(listProperty.emptyProperty());
        view().getUpdated().disableProperty().bind(listProperty.emptyProperty());
        view().getUpgraded().disableProperty().bind(listProperty.emptyProperty());
    }
83076
public List<Map> getValues() {
        if (values == null) {
            values = Reflection.toTypedList(getMap().get(BATCH_INSERTION_VALUES_KEY), Map.class);
        }
        return values;
    }
1080223
function addToOperationsList(bulkOperation, docType, document) {
  // Get the bsonSize
  const bsonSize = bson.calculateObjectSize(document, {
    checkKeys: false
  });

  // Throw error if the doc is bigger than the max BSON size
  if (bsonSize >= bulkOperation.s.maxBatchSizeBytes)
    throw toError('document is larger than the maximum size ' + bulkOperation.s.maxBatchSizeBytes);

  // Create a new batch object if we don't have a current one
  if (bulkOperation.s.currentBatch == null)
    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);

  // Check if we need to create a new batch
  if (
    bulkOperation.s.currentBatchSize + 1 >= bulkOperation.s.maxWriteBatchSize ||
    bulkOperation.s.currentBatchSizeBytes + bulkOperation.s.currentBatchSizeBytes >=
      bulkOperation.s.maxBatchSizeBytes ||
    bulkOperation.s.currentBatch.batchType !== docType
  ) {
    // Save the batch to the execution stack
    bulkOperation.s.batches.push(bulkOperation.s.currentBatch);

    // Create a new batch
    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);

    // Reset the current size trackers
    bulkOperation.s.currentBatchSize = 0;
    bulkOperation.s.currentBatchSizeBytes = 0;
  } else {
    // Update current batch size
    bulkOperation.s.currentBatchSize = bulkOperation.s.currentBatchSize + 1;
    bulkOperation.s.currentBatchSizeBytes = bulkOperation.s.currentBatchSizeBytes + bsonSize;
  }

  if (docType === common.INSERT) {
    bulkOperation.s.bulkResult.insertedIds.push({
      index: bulkOperation.s.currentIndex,
      _id: document._id
    });
  }

  // We have an array of documents
  if (Array.isArray(document)) {
    throw toError('operation passed in cannot be an Array');
  } else {
    bulkOperation.s.currentBatch.originalIndexes.push(bulkOperation.s.currentIndex);
    bulkOperation.s.currentBatch.operations.push(document);
    bulkOperation.s.currentBatchSizeBytes = bulkOperation.s.currentBatchSizeBytes + bsonSize;
    bulkOperation.s.currentIndex = bulkOperation.s.currentIndex + 1;
  }

  // Return bulkOperation
  return bulkOperation;
}
133066
public Batchlet<Step<T>> getOrCreateBatchlet()
   {
      Node node = childNode.getOrCreate("batchlet");
      Batchlet<Step<T>> batchlet = new BatchletImpl<Step<T>>(this, "batchlet", childNode, node);
      return batchlet;
   }
1193075
@WithBridgeMethods(value = SQLDeleteClause.class, castRequired =  true)
    public C addBatch() {
        batches.add(metadata);
        metadata = new DefaultQueryMetadata();
        metadata.addJoin(JoinType.DEFAULT, entity);
        metadata.setValidatingVisitor(validatingVisitor);
        return (C) this;
    }
834031
public Iterator<QueryBinding> iterator() 
	{
		List<QueryBinding> iBindings = new ArrayList<QueryBinding>();
		for(QueryBindingImpl b : bindings) {
			iBindings.add(b);
		}
		return iBindings.iterator();
	}
1092438
function() {
      var self = this;
      // Start by removing all old bindings and falling back to the initialized binding contents
      this.bindings = _.extend({}, this._bindings);

      // Stickit model two-way bindings
      _.each(this.$('[data-model]'), function(element) {
        var attr = $(element).data('model'),
            options = self.__getFieldOptions(attr),
            fieldBinding = self.__generateModelFieldBinding(attr, options);

        //add select options
        if ($(element).is('select')) {
          fieldBinding.selectOptions = self.__generateSelectOptions(element, options);
        }

        self.bindings['[data-model="' + attr + '"]'] = fieldBinding;
      });
    }