Skip to content

Commit 789b3c2

Browse files
committed
Change function names from put to insert
1 parent 17c6dfa commit 789b3c2

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

microservice-transaction-sample/customer-service/src/main/java/sample/customer/CustomerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private void loadCustomerIfNotExists(
7474
throws CrudException {
7575
Optional<Customer> customer = Customer.get(transaction, id);
7676
if (!customer.isPresent()) {
77-
Customer.put(transaction, id, name, creditLimit, creditTotal);
77+
Customer.insert(transaction, id, name, creditLimit, creditTotal);
7878
}
7979
}
8080

microservice-transaction-sample/customer-service/src/main/java/sample/customer/model/Customer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public Customer(int id, String name, int creditLimit, int creditTotal) {
2828
this.creditTotal = creditTotal;
2929
}
3030

31-
public static void put(
31+
public static void insert(
3232
TransactionCrudOperable transaction, int id, String name, int creditLimit, int creditTotal)
3333
throws CrudException {
3434
transaction.insert(

microservice-transaction-sample/order-service/src/main/java/sample/order/OrderService.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private void loadItemIfNotExists(
9494
DistributedTransaction transaction, int id, String name, int price) throws CrudException {
9595
Optional<Item> item = Item.get(transaction, id);
9696
if (!item.isPresent()) {
97-
Item.put(transaction, id, name, price);
97+
Item.insert(transaction, id, name, price);
9898
}
9999
}
100100

@@ -106,13 +106,13 @@ public void placeOrder(
106106
transaction -> {
107107
String orderId = UUID.randomUUID().toString();
108108

109-
// Put the order info into the orders table
110-
Order.put(transaction, orderId, request.getCustomerId(), System.currentTimeMillis());
109+
// Insert the order info into the orders table
110+
Order.insert(transaction, orderId, request.getCustomerId(), System.currentTimeMillis());
111111

112112
int amount = 0;
113113
for (ItemOrder itemOrder : request.getItemOrderList()) {
114-
// Put the order statement into the statements table
115-
Statement.put(transaction, orderId, itemOrder.getItemId(), itemOrder.getCount());
114+
// Insert the order statement into the statements table
115+
Statement.insert(transaction, orderId, itemOrder.getItemId(), itemOrder.getCount());
116116

117117
// Retrieve the item info from the items table
118118
Optional<Item> item = Item.get(transaction, itemOrder.getItemId());

microservice-transaction-sample/order-service/src/main/java/sample/order/model/Item.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public Item(int id, String name, int price) {
2525
this.price = price;
2626
}
2727

28-
public static void put(TransactionCrudOperable transaction, int id, String name, int price)
28+
public static void insert(TransactionCrudOperable transaction, int id, String name, int price)
2929
throws CrudException {
3030
transaction.insert(
3131
Insert.newBuilder()

microservice-transaction-sample/order-service/src/main/java/sample/order/model/Order.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public Order(String id, int customerId, long timestamp) {
3030
this.timestamp = timestamp;
3131
}
3232

33-
public static void put(
33+
public static void insert(
3434
TransactionCrudOperable transaction, String id, int customerId, long timestamp)
3535
throws CrudException {
3636
transaction.insert(

microservice-transaction-sample/order-service/src/main/java/sample/order/model/Statement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public Statement(String orderId, int itemId, int count) {
2626
this.count = count;
2727
}
2828

29-
public static void put(TransactionCrudOperable transaction, String orderId, int itemId, int count)
29+
public static void insert(TransactionCrudOperable transaction, String orderId, int itemId, int count)
3030
throws CrudException {
3131
transaction.insert(
3232
Insert.newBuilder()

0 commit comments

Comments
 (0)