Skip to content

Commit 8212fc2

Browse files
authored
Merge pull request #471 from Backendless/mkhobotin/22834/fix_json_operations
[BKNDLSS-22834] Fix JSONUpdateBuilder operations
2 parents 2883509 + 050d526 commit 8212fc2

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/com/backendless/persistence/JSONUpdateBuilder.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,30 @@ public final class JSONUpdateBuilder
1313

1414
public enum Operation
1515
{
16-
SET, INSERT, REPLACE, REMOVE, ARRAY_APPEND, ARRAY_INSERT;
16+
SET("JSON_SET"),
17+
INSERT("JSON_INSERT"),
18+
REPLACE("JSON_REPLACE"),
19+
REMOVE("JSON_REMOVE"),
20+
ARRAY_APPEND("JSON_ARRAY_APPEND"),
21+
ARRAY_INSERT("JSON_ARRAY_INSERT");
22+
23+
private String operationName;
24+
25+
Operation(String operationName) {
26+
this.operationName = operationName;
27+
}
28+
29+
public String getOperationName() {
30+
return operationName;
31+
}
1732
}
1833

1934

2035
private final HashMap<String, Object> jsonUpdate = new HashMap<>();
2136

2237
private JSONUpdateBuilder(Operation op)
2338
{
24-
jsonUpdate.put(OPERATION_FIELD_NAME, op.name());
39+
jsonUpdate.put(OPERATION_FIELD_NAME, op.getOperationName());
2540
}
2641

2742

0 commit comments

Comments
 (0)