Skip to content

Commit 9af19e8

Browse files
committed
fix(java): suffix complex example partition keys with -java to avoid collisions
1 parent 5e444da commit 9af19e8

2 files changed

Lines changed: 116 additions & 55 deletions

File tree

Examples/runtimes/java/DynamoDbEncryption/src/main/java/software/amazon/cryptography/examples/searchableencryption/complexexample/PutRequests.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void putAllMeetingItemsToTable(
5858
final HashMap<String, AttributeValue> meeting1 = new HashMap<>();
5959
meeting1.put(
6060
"partition_key",
61-
AttributeValue.builder().s("meeting1").build()
61+
AttributeValue.builder().s("meeting1-java").build()
6262
);
6363
meeting1.put("EmployeeID", AttributeValue.builder().s("emp_001").build());
6464
meeting1.put(
@@ -99,7 +99,7 @@ public static void putAllMeetingItemsToTable(
9999
final HashMap<String, AttributeValue> meeting2 = new HashMap<>();
100100
meeting2.put(
101101
"partition_key",
102-
AttributeValue.builder().s("meeting2").build()
102+
AttributeValue.builder().s("meeting2-java").build()
103103
);
104104
meeting2.put("EmployeeID", AttributeValue.builder().s("emp_002").build());
105105
meeting2.put(
@@ -140,7 +140,7 @@ public static void putAllMeetingItemsToTable(
140140
final HashMap<String, AttributeValue> meeting3 = new HashMap<>();
141141
meeting3.put(
142142
"partition_key",
143-
AttributeValue.builder().s("meeting3").build()
143+
AttributeValue.builder().s("meeting3-java").build()
144144
);
145145
meeting3.put("EmployeeID", AttributeValue.builder().s("emp_003").build());
146146
meeting3.put(
@@ -181,7 +181,7 @@ public static void putAllMeetingItemsToTable(
181181
final HashMap<String, AttributeValue> meeting4 = new HashMap<>();
182182
meeting4.put(
183183
"partition_key",
184-
AttributeValue.builder().s("meeting4").build()
184+
AttributeValue.builder().s("meeting4-java").build()
185185
);
186186
meeting4.put("EmployeeID", AttributeValue.builder().s("emp_004").build());
187187
meeting4.put(
@@ -222,7 +222,7 @@ public static void putAllMeetingItemsToTable(
222222
final HashMap<String, AttributeValue> meeting5 = new HashMap<>();
223223
meeting5.put(
224224
"partition_key",
225-
AttributeValue.builder().s("meeting5").build()
225+
AttributeValue.builder().s("meeting5-java").build()
226226
);
227227
meeting5.put("EmployeeID", AttributeValue.builder().s("emp_002").build());
228228
meeting5.put(
@@ -263,7 +263,7 @@ public static void putAllMeetingItemsToTable(
263263
final HashMap<String, AttributeValue> meeting6 = new HashMap<>();
264264
meeting6.put(
265265
"partition_key",
266-
AttributeValue.builder().s("meeting6").build()
266+
AttributeValue.builder().s("meeting6-java").build()
267267
);
268268
meeting6.put("EmployeeID", AttributeValue.builder().s("emp_003").build());
269269
meeting6.put(
@@ -307,7 +307,7 @@ public static void putAllEmployeeItemsToTable(
307307
final HashMap<String, AttributeValue> employee1 = new HashMap<>();
308308
employee1.put(
309309
"partition_key",
310-
AttributeValue.builder().s("employee1").build()
310+
AttributeValue.builder().s("employee1-java").build()
311311
);
312312
employee1.put("EmployeeID", AttributeValue.builder().s("emp_001").build());
313313
employee1.put(
@@ -344,7 +344,7 @@ public static void putAllEmployeeItemsToTable(
344344
final HashMap<String, AttributeValue> employee2 = new HashMap<>();
345345
employee2.put(
346346
"partition_key",
347-
AttributeValue.builder().s("employee2").build()
347+
AttributeValue.builder().s("employee2-java").build()
348348
);
349349
employee2.put("EmployeeID", AttributeValue.builder().s("emp_002").build());
350350
employee2.put(
@@ -381,7 +381,7 @@ public static void putAllEmployeeItemsToTable(
381381
final HashMap<String, AttributeValue> employee3 = new HashMap<>();
382382
employee3.put(
383383
"partition_key",
384-
AttributeValue.builder().s("employee3").build()
384+
AttributeValue.builder().s("employee3-java").build()
385385
);
386386
employee3.put("EmployeeID", AttributeValue.builder().s("emp_003").build());
387387
employee3.put(
@@ -415,7 +415,7 @@ public static void putAllEmployeeItemsToTable(
415415
final HashMap<String, AttributeValue> employee4 = new HashMap<>();
416416
employee4.put(
417417
"partition_key",
418-
AttributeValue.builder().s("employee4").build()
418+
AttributeValue.builder().s("employee4-java").build()
419419
);
420420
employee4.put("EmployeeID", AttributeValue.builder().s("emp_004").build());
421421
employee4.put(
@@ -449,7 +449,7 @@ public static void putAllProjectItemsToTable(
449449
final HashMap<String, AttributeValue> project1 = new HashMap<>();
450450
project1.put(
451451
"partition_key",
452-
AttributeValue.builder().s("project1").build()
452+
AttributeValue.builder().s("project1-java").build()
453453
);
454454
project1.put(
455455
"ProjectName",
@@ -479,7 +479,7 @@ public static void putAllProjectItemsToTable(
479479
final HashMap<String, AttributeValue> project2 = new HashMap<>();
480480
project2.put(
481481
"partition_key",
482-
AttributeValue.builder().s("project2").build()
482+
AttributeValue.builder().s("project2-java").build()
483483
);
484484
project2.put(
485485
"ProjectName",
@@ -506,7 +506,7 @@ public static void putAllProjectItemsToTable(
506506
final HashMap<String, AttributeValue> project3 = new HashMap<>();
507507
project3.put(
508508
"partition_key",
509-
AttributeValue.builder().s("project3").build()
509+
AttributeValue.builder().s("project3-java").build()
510510
);
511511
project3.put(
512512
"ProjectName",
@@ -530,7 +530,7 @@ public static void putAllProjectItemsToTable(
530530
final HashMap<String, AttributeValue> project4 = new HashMap<>();
531531
project4.put(
532532
"partition_key",
533-
AttributeValue.builder().s("project4").build()
533+
AttributeValue.builder().s("project4-java").build()
534534
);
535535
project4.put(
536536
"ProjectName",
@@ -577,7 +577,7 @@ public static void putAllReservationItemsToTable(
577577
final HashMap<String, AttributeValue> reservation1 = new HashMap<>();
578578
reservation1.put(
579579
"partition_key",
580-
AttributeValue.builder().s("reservation1").build()
580+
AttributeValue.builder().s("reservation1-java").build()
581581
);
582582
reservation1.put(
583583
"Location",
@@ -629,7 +629,7 @@ public static void putAllReservationItemsToTable(
629629
final HashMap<String, AttributeValue> reservation2 = new HashMap<>();
630630
reservation2.put(
631631
"partition_key",
632-
AttributeValue.builder().s("reservation2").build()
632+
AttributeValue.builder().s("reservation2-java").build()
633633
);
634634
reservation2.put(
635635
"Location",
@@ -665,7 +665,7 @@ public static void putAllTicketItemsToTable(
665665
DynamoDbClient ddb
666666
) {
667667
final HashMap<String, AttributeValue> ticket1 = new HashMap<>();
668-
ticket1.put("partition_key", AttributeValue.builder().s("ticket1").build());
668+
ticket1.put("partition_key", AttributeValue.builder().s("ticket1-java").build());
669669
ticket1.put(
670670
"TicketNumber",
671671
AttributeValue.builder().s("ticket_001").build()
@@ -694,7 +694,7 @@ public static void putAllTicketItemsToTable(
694694
);
695695

696696
final HashMap<String, AttributeValue> ticket2 = new HashMap<>();
697-
ticket2.put("partition_key", AttributeValue.builder().s("ticket2").build());
697+
ticket2.put("partition_key", AttributeValue.builder().s("ticket2-java").build());
698698
ticket2.put(
699699
"TicketNumber",
700700
AttributeValue.builder().s("ticket_001").build()
@@ -723,7 +723,7 @@ public static void putAllTicketItemsToTable(
723723
);
724724

725725
final HashMap<String, AttributeValue> ticket3 = new HashMap<>();
726-
ticket3.put("partition_key", AttributeValue.builder().s("ticket3").build());
726+
ticket3.put("partition_key", AttributeValue.builder().s("ticket3-java").build());
727727
ticket3.put(
728728
"TicketNumber",
729729
AttributeValue.builder().s("ticket_002").build()
@@ -752,7 +752,7 @@ public static void putAllTicketItemsToTable(
752752
);
753753

754754
final HashMap<String, AttributeValue> ticket4 = new HashMap<>();
755-
ticket4.put("partition_key", AttributeValue.builder().s("ticket4").build());
755+
ticket4.put("partition_key", AttributeValue.builder().s("ticket4-java").build());
756756
ticket4.put(
757757
"TicketNumber",
758758
AttributeValue.builder().s("ticket_002").build()
@@ -789,7 +789,7 @@ public static void putAllTimecardItemsToTable(
789789
final HashMap<String, AttributeValue> timecard1 = new HashMap<>();
790790
timecard1.put(
791791
"partition_key",
792-
AttributeValue.builder().s("timecard1").build()
792+
AttributeValue.builder().s("timecard1-java").build()
793793
);
794794
timecard1.put(
795795
"ProjectName",
@@ -813,7 +813,7 @@ public static void putAllTimecardItemsToTable(
813813
final HashMap<String, AttributeValue> timecard2 = new HashMap<>();
814814
timecard2.put(
815815
"partition_key",
816-
AttributeValue.builder().s("timecard2").build()
816+
AttributeValue.builder().s("timecard2-java").build()
817817
);
818818
timecard2.put(
819819
"ProjectName",
@@ -837,7 +837,7 @@ public static void putAllTimecardItemsToTable(
837837
final HashMap<String, AttributeValue> timecard3 = new HashMap<>();
838838
timecard3.put(
839839
"partition_key",
840-
AttributeValue.builder().s("timecard3").build()
840+
AttributeValue.builder().s("timecard3-java").build()
841841
);
842842
timecard3.put(
843843
"ProjectName",
@@ -861,7 +861,7 @@ public static void putAllTimecardItemsToTable(
861861
final HashMap<String, AttributeValue> timecard4 = new HashMap<>();
862862
timecard4.put(
863863
"partition_key",
864-
AttributeValue.builder().s("timecard4").build()
864+
AttributeValue.builder().s("timecard4-java").build()
865865
);
866866
timecard4.put(
867867
"ProjectName",

0 commit comments

Comments
 (0)