Class MongoDBConverter.UpdateBuilder
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.mongodb.MongoDBConverter.UpdateBuilder
-
- Enclosing class:
- MongoDBConverter
public class MongoDBConverter.UpdateBuilder extends Object
Update list builder to prevent several updates of the same field.This happens if two operations act on two fields where one is a prefix of the other.
Example: Cannot update 'mylist.0.string' and 'mylist' at the same time (error 16837)
- Since:
- 5.9.5
-
-
Field Summary
Fields Modifier and Type Field Description protected MongoDBConverter.ConditionsAndUpdates
conditionsAndUpdates
protected org.bson.Document
inc
protected Set<String>
keys
protected Set<String>
prefixKeys
protected org.bson.Document
pull
protected org.bson.Document
push
protected org.bson.Document
set
protected org.bson.Document
unset
protected org.bson.Document
update
-
Constructor Summary
Constructors Constructor Description UpdateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MongoDBConverter.ConditionsAndUpdates
build(State.StateDiff diff)
protected void
checkForConflict(String key)
Checks if the key conflicts with one of the previous keys.protected boolean
conflictKeys(String key, List<String> subkeys)
protected List<String>
getPrefixKeys(String key)
return a list of parents keyprotected void
newUpdate()
protected void
processDelta(Delta delta, String prefix)
protected void
processListDiff(State.ListDiff listDiff, String prefix)
protected void
processStateDiff(State.StateDiff diff, String prefix)
protected void
processValue(String name, Serializable value)
protected void
update(String op, String bsonKey, Object val)
-
-
-
Field Detail
-
set
protected final org.bson.Document set
-
unset
protected final org.bson.Document unset
-
push
protected final org.bson.Document push
-
pull
protected final org.bson.Document pull
-
inc
protected final org.bson.Document inc
-
conditionsAndUpdates
protected final MongoDBConverter.ConditionsAndUpdates conditionsAndUpdates
-
update
protected org.bson.Document update
-
-
Method Detail
-
build
public MongoDBConverter.ConditionsAndUpdates build(State.StateDiff diff)
-
processStateDiff
protected void processStateDiff(State.StateDiff diff, String prefix)
-
processListDiff
protected void processListDiff(State.ListDiff listDiff, String prefix)
-
processValue
protected void processValue(String name, Serializable value)
-
newUpdate
protected void newUpdate()
-
checkForConflict
protected void checkForConflict(String key)
Checks if the key conflicts with one of the previous keys.A conflict occurs if one key is equals to or is a prefix of the other.
-
-