Class MongoBulkInsertHelper<F,E extends F>
java.lang.Object
io.clonecloudstore.common.database.mongo.MongoBulkInsertHelper<F,E>
- Type Parameters:
E
- the DTO type to use
Mongo implementation of the BulkHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List
<org.bson.Document> protected final List
<org.bson.Document> static final int
protected final ExtendedPanacheMongoRepositoryBase
<F, E> -
Constructor Summary
ConstructorsConstructorDescriptionMongoBulkInsertHelper
(ExtendedPanacheMongoRepositoryBase<F, E> repositoryBase) Constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
addToInsertBulk
(E object) boolean
addToUpdateBulk
(org.bson.Document findQuery, org.bson.Document update) boolean
addToUpsertBulk
(org.bson.Document findQuery, E original) Persist all elements using bulk operationUpsert Persist all elements using bulk operationprotected int
-
Field Details
-
MAX_BATCH
public static final int MAX_BATCH- See Also:
-
repositoryBase
-
listInsert
-
listFindQuery
-
listUpdate
-
listInsertForUpdate
-
-
Constructor Details
-
MongoBulkInsertHelper
Constructor
-
-
Method Details
-
addToInsertBulk
- Parameters:
object
- the element to persist within a bulk operation- Returns:
- True if bulk operation reaches the limit
-
getMaxBatch
protected int getMaxBatch()- Returns:
- the current max batch value
-
bulkPersist
Persist all elements using bulk operation- Returns:
- this
- Throws:
CcsDbException
-
addToUpsertBulk
- Parameters:
findQuery
- the find query associated in order with Upsertoriginal
- the original one for insert (null means update only)- Returns:
- True if bulk operation reaches the limit
-
addToUpdateBulk
public boolean addToUpdateBulk(org.bson.Document findQuery, org.bson.Document update) - Parameters:
findQuery
- the find query associated in order with Upsertupdate
- the update part- Returns:
- True if bulk operation reaches the limit
-
bulkUpsert
Upsert Persist all elements using bulk operation- Returns:
- this
- Throws:
CcsDbException
-