-
Notifications
You must be signed in to change notification settings - Fork 254
/
com.azure.cosmos.models.CosmosBatch.yml
263 lines (263 loc) · 22.9 KB
/
com.azure.cosmos.models.CosmosBatch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
### YamlMime:JavaType
uid: "com.azure.cosmos.models.CosmosBatch"
fullName: "com.azure.cosmos.models.CosmosBatch"
name: "CosmosBatch"
nameWithType: "CosmosBatch"
summary: "Represents a batch of operations against items with the same <xref uid=\"com.azure.cosmos.models.PartitionKey\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionKey\"></xref> in a container that will be performed in a Cosmos manner at the Azure Cosmos DB service."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **CosmosBatch**"
methods:
- uid: "com.azure.cosmos.models.CosmosBatch.<T>createItemOperation(T)"
fullName: "com.azure.cosmos.models.CosmosBatch.createItemOperation(T item)"
name: "createItemOperation(T item)"
nameWithType: "CosmosBatch.createItemOperation(T item)"
summary: "Adds an operation to create an item into the batch."
parameters:
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>createItemOperation(T item)"
desc: "Adds an operation to create an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.<T>createItemOperation(T,com.azure.cosmos.models.CosmosBatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.createItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
name: "createItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.createItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
summary: "Adds an operation to create an item into the batch."
parameters:
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchItemRequestOptions&text=CosmosBatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>createItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
desc: "Adds an operation to create an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.<T>replaceItemOperation(java.lang.String,T)"
fullName: "com.azure.cosmos.models.CosmosBatch.replaceItemOperation(String id, T item)"
name: "replaceItemOperation(String id, T item)"
nameWithType: "CosmosBatch.replaceItemOperation(String id, T item)"
summary: "Adds an operation to replace an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>replaceItemOperation(String id, T item)"
desc: "Adds an operation to replace an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.<T>replaceItemOperation(java.lang.String,T,com.azure.cosmos.models.CosmosBatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.replaceItemOperation(String id, T item, CosmosBatchItemRequestOptions requestOptions)"
name: "replaceItemOperation(String id, T item, CosmosBatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.replaceItemOperation(String id, T item, CosmosBatchItemRequestOptions requestOptions)"
summary: "Adds an operation to replace an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchItemRequestOptions&text=CosmosBatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>replaceItemOperation(String id, T item, CosmosBatchItemRequestOptions requestOptions)"
desc: "Adds an operation to replace an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.<T>upsertItemOperation(T)"
fullName: "com.azure.cosmos.models.CosmosBatch.upsertItemOperation(T item)"
name: "upsertItemOperation(T item)"
nameWithType: "CosmosBatch.upsertItemOperation(T item)"
summary: "Adds an operation to upsert an item into the batch."
parameters:
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>upsertItemOperation(T item)"
desc: "Adds an operation to upsert an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.<T>upsertItemOperation(T,com.azure.cosmos.models.CosmosBatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.upsertItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
name: "upsertItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.upsertItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
summary: "Adds an operation to upsert an item into the batch."
parameters:
- description: "A JSON serializable object that must contain an id property."
name: "item"
type: "<xref href=\"T?alt=T&text=T\" data-throw-if-not-resolved=\"False\" />"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchItemRequestOptions&text=CosmosBatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation <T>upsertItemOperation(T item, CosmosBatchItemRequestOptions requestOptions)"
desc: "Adds an operation to upsert an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.createCosmosBatch(com.azure.cosmos.models.PartitionKey)"
fullName: "com.azure.cosmos.models.CosmosBatch.createCosmosBatch(PartitionKey partitionKey)"
name: "createCosmosBatch(PartitionKey partitionKey)"
nameWithType: "CosmosBatch.createCosmosBatch(PartitionKey partitionKey)"
summary: "Initializes a new instance of <xref uid=\"com.azure.cosmos.models.CosmosBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosBatch\"></xref> that will contain operations to be performed across multiple items in the container with the provided partition key in a transactional manner"
modifiers:
- "static"
parameters:
- description: "the partition key for all items in the batch."
name: "partitionKey"
type: "<xref href=\"com.azure.cosmos.models.PartitionKey?alt=com.azure.cosmos.models.PartitionKey&text=PartitionKey\" data-throw-if-not-resolved=\"False\" />"
syntax: "public static CosmosBatch createCosmosBatch(PartitionKey partitionKey)"
desc: "Initializes a new instance of <xref uid=\"com.azure.cosmos.models.CosmosBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosBatch\"></xref> that will contain operations to be performed across multiple items in the container with the provided partition key in a transactional manner"
returns:
description: "A new instance of <xref uid=\"com.azure.cosmos.models.CosmosBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosBatch\"></xref>."
type: "<xref href=\"com.azure.cosmos.models.CosmosBatch?alt=com.azure.cosmos.models.CosmosBatch&text=CosmosBatch\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.deleteItemOperation(java.lang.String)"
fullName: "com.azure.cosmos.models.CosmosBatch.deleteItemOperation(String id)"
name: "deleteItemOperation(String id)"
nameWithType: "CosmosBatch.deleteItemOperation(String id)"
summary: "Adds an operation to delete an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CosmosItemOperation deleteItemOperation(String id)"
desc: "Adds an operation to delete an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.deleteItemOperation(java.lang.String,com.azure.cosmos.models.CosmosBatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.deleteItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
name: "deleteItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.deleteItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
summary: "Adds an operation to delete an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchItemRequestOptions&text=CosmosBatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation deleteItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
desc: "Adds an operation to delete an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.getOperations()"
fullName: "com.azure.cosmos.models.CosmosBatch.getOperations()"
name: "getOperations()"
nameWithType: "CosmosBatch.getOperations()"
summary: "Return the list of operation in an unmodifiable instance so no one can change it in the down path."
syntax: "public List<CosmosItemOperation> getOperations()"
desc: "Return the list of operation in an unmodifiable instance so no one can change it in the down path."
returns:
description: "The list of operations which are to be executed."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a><<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />>"
- uid: "com.azure.cosmos.models.CosmosBatch.getPartitionKeyValue()"
fullName: "com.azure.cosmos.models.CosmosBatch.getPartitionKeyValue()"
name: "getPartitionKeyValue()"
nameWithType: "CosmosBatch.getPartitionKeyValue()"
summary: "Return the partition key for this batch."
syntax: "public PartitionKey getPartitionKeyValue()"
desc: "Return the partition key for this batch."
returns:
description: "The partition key for this batch."
type: "<xref href=\"com.azure.cosmos.models.PartitionKey?alt=com.azure.cosmos.models.PartitionKey&text=PartitionKey\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.patchItemOperation(java.lang.String,com.azure.cosmos.models.CosmosPatchOperations)"
fullName: "com.azure.cosmos.models.CosmosBatch.patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations)"
name: "patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations)"
nameWithType: "CosmosBatch.patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations)"
summary: "Adds a patch operations for an item into the batch."
parameters:
- description: "the item id."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Represents a container having list of operations to be sequentially applied to the referred Cosmos item."
name: "cosmosPatchOperations"
type: "<xref href=\"com.azure.cosmos.models.CosmosPatchOperations?alt=com.azure.cosmos.models.CosmosPatchOperations&text=CosmosPatchOperations\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations)"
desc: "Adds a patch operations for an item into the batch."
returns:
description: "The added operation."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.patchItemOperation(java.lang.String,com.azure.cosmos.models.CosmosPatchOperations,com.azure.cosmos.models.CosmosBatchPatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations, CosmosBatchPatchItemRequestOptions requestOptions)"
name: "patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations, CosmosBatchPatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations, CosmosBatchPatchItemRequestOptions requestOptions)"
summary: "Adds a patch operations for an item into the batch."
parameters:
- description: "the item id."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "Represents a container having list of operations to be sequentially applied to the referred Cosmos item."
name: "cosmosPatchOperations"
type: "<xref href=\"com.azure.cosmos.models.CosmosPatchOperations?alt=com.azure.cosmos.models.CosmosPatchOperations&text=CosmosPatchOperations\" data-throw-if-not-resolved=\"False\" />"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchPatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchPatchItemRequestOptions&text=CosmosBatchPatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation patchItemOperation(String id, CosmosPatchOperations cosmosPatchOperations, CosmosBatchPatchItemRequestOptions requestOptions)"
desc: "Adds a patch operations for an item into the batch."
returns:
description: "The added operation."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.readItemOperation(java.lang.String)"
fullName: "com.azure.cosmos.models.CosmosBatch.readItemOperation(String id)"
name: "readItemOperation(String id)"
nameWithType: "CosmosBatch.readItemOperation(String id)"
summary: "Adds an operation to read an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public CosmosItemOperation readItemOperation(String id)"
desc: "Adds an operation to read an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.cosmos.models.CosmosBatch.readItemOperation(java.lang.String,com.azure.cosmos.models.CosmosBatchItemRequestOptions)"
fullName: "com.azure.cosmos.models.CosmosBatch.readItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
name: "readItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
nameWithType: "CosmosBatch.readItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
summary: "Adds an operation to read an item into the batch."
parameters:
- description: "The unique id of the item."
name: "id"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The options for the item request."
name: "requestOptions"
type: "<xref href=\"com.azure.cosmos.models.CosmosBatchItemRequestOptions?alt=com.azure.cosmos.models.CosmosBatchItemRequestOptions&text=CosmosBatchItemRequestOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public CosmosItemOperation readItemOperation(String id, CosmosBatchItemRequestOptions requestOptions)"
desc: "Adds an operation to read an item into the batch."
returns:
description: "The Cosmos batch instance with the operation added."
type: "<xref href=\"com.azure.cosmos.models.CosmosItemOperation?alt=com.azure.cosmos.models.CosmosItemOperation&text=CosmosItemOperation\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Represents a batch of operations against items with the same <xref uid=\"com.azure.cosmos.models.PartitionKey\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PartitionKey\"></xref> in a container that will be performed in a Cosmos manner at the Azure Cosmos DB service.\n\nUse <xref uid=\"com.azure.cosmos.models.CosmosBatch.createCosmosBatch(com.azure.cosmos.models.PartitionKey)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosBatch#createCosmosBatch(PartitionKey)\"></xref> to create an instance of <xref uid=\"com.azure.cosmos.models.CosmosBatch\" data-throw-if-not-resolved=\"false\" data-raw-source=\"CosmosBatch\"></xref>. **Example** This example atomically modifies a set of items as a batch.\n\n```java\npublic class ToDoActivity {\n public final String type;\n public final String id;\n public final String status;\n public ToDoActivity(String type, String id, String status) {\n this.type = type;\n this.id = id;\n this.status = status;\n }\n }\n\n String activityType = \"personal\";\n\n ToDoActivity test1 = new ToDoActivity(activityType, \"learning\", \"ToBeDone\");\n ToDoActivity test2 = new ToDoActivity(activityType, \"shopping\", \"Done\");\n ToDoActivity test3 = new ToDoActivity(activityType, \"swimming\", \"ToBeDone\");\n\n CosmosBatch batch = CosmosBatch.createCosmosBatch(new Cosmos.PartitionKey(activityType));\n batch.createItemOperation(test1);\n batch.replaceItemOperation(test2.id, test2);\n batch.upsertItemOperation(test3);\n batch.deleteItemOperation(\"reading\");\n\n CosmosBatchResponse response = container.executeTransactionalBatch(batch);\n\n if (!response.isSuccessStatusCode()) {\n // Handle and log exception\n return;\n }\n\n // Look up interested results - e.g., via typed access on operation results\n\n CosmosBatchOperationResult result = response.get(0);\n ToDoActivity readActivity = result.getItem(ToDoActivity.class);\n```\n\n**Example**\n\nThis example atomically reads a set of items as a batch.\n\n```java\nString activityType = \"personal\";\n\n CosmosBatch batch = CosmosBatch.createCosmosBatch(new Cosmos.PartitionKey(activityType));\n batch.readItemOperation(\"playing\");\n batch.readItemOperation(\"walking\");\n batch.readItemOperation(\"jogging\");\n batch.readItemOperation(\"running\");\n\n CosmosBatchResponse response = container.executeTransactionalBatch(batch);\n List resultItems = new ArrayList();\n\n for (int i = 0; i < response.size(); i++) {\n CosmosBatchOperationResult result = response.get(0);\n resultItems.add(result.getItem(ToDoActivity.class));\n }\n```\n\n**See:** [Limits on CosmosBatch requests][].\n\n\n[Limits on CosmosBatch requests]: https://docs.microsoft.com/azure/cosmos-db/concepts-limits"
metadata: {}
package: "com.azure.cosmos.models"
artifact: com.azure:azure-cosmos:4.63.0