![JAR search and dependency download from the Maven repository](/logo.png)
com.despegar.integration.mongo.query.Bulk Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mongo-connector Show documentation
Show all versions of mongo-connector Show documentation
Helper component to connect to mongo fast and easy
package com.despegar.integration.mongo.query;
import java.util.ArrayList;
import java.util.List;
import com.despegar.integration.mongo.entities.Bulkeable;
import com.despegar.integration.mongo.entities.GenericIdentifiableEntity;
public class Bulk>{
private List operationsList = new ArrayList();
private Boolean orderRequired = Boolean.FALSE;
public Bulk insert(List entities){
List> listToInsert = new ArrayList>();
BulkInsert entityToInsert;
for(T entity:entities){
entityToInsert = new BulkInsert(entity);
listToInsert.add(entityToInsert);
}
this.operationsList.addAll(listToInsert);
return this;
}
public Bulk insert(T entity){
BulkInsert entityToInsert = new BulkInsert(entity);
this.operationsList.add(entityToInsert);
return this;
}
public BulkFind find(Query query){
BulkFind findInstance = new BulkFind(query);
operationsList.add(findInstance);
return findInstance;
}
public BulkFind find(X id){
Query query = new Query();
query.equals("_id", id);
BulkFind findInstance = new BulkFind(query);
operationsList.add(findInstance);
return findInstance;
}
public Boolean getOrderRequired() {
return orderRequired;
}
public void isOrderRequired(Boolean orderRequired) {
this.orderRequired = orderRequired;
}
public List getOperationsList() {
return operationsList;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy