Skip to content

Commit

Permalink
control list field type in bookorder class, server functions lab
Browse files Browse the repository at this point in the history
  • Loading branch information
eitansuez committed Sep 25, 2017
1 parent a1c39d1 commit 2c4ebfc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server-bootstrap/cluster/start.gf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

start locator --name=locator --properties-file=gemfire.properties --initial-heap=50m --max-heap=50m

set variable --name=CP --value=../../build/classes/java/main
set variable --name=CP --value=../../build/classes/java/main:../../../domain/build/classes/java/main

start server --name=server1 --server-port=0 --properties-file=gemfire.properties --initial-heap=50m --max-heap=50m --classpath=${CP}
start server --name=server2 --server-port=0 --properties-file=gemfire.properties --initial-heap=50m --max-heap=50m --classpath=${CP}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,20 @@ private static void populateBookOrders(ClientCache cache) {
// Order for Kari Powell for book: A Treatise of Treatises
BookOrder order1 = BookOrder.builder().orderNumber(17699).orderDate(new Date())
.shippingCost(5.99f).shipDate(new Date())
.orderItem(BookOrderItem.builder().orderLine(1).itemNumber(123).build())
.customerNumber(5598).totalPrice(40.98f)
.build();
order1.getOrderItems().add(
BookOrderItem.builder().orderLine(1).itemNumber(123).build()
);
orders.put(17699L, order1);

// Order for Lula Wax book: A Treatise of Treatises & Clifford the Big Red Dog
BookOrder order2 = BookOrder.builder().orderNumber(17700).orderDate(new Date())
.shippingCost(5.99f).shipDate(new Date())
.orderItem(BookOrderItem.builder().orderLine(1).itemNumber(123).build())
.orderItem(BookOrderItem.builder().orderLine(2).itemNumber(456).build())
.customerNumber(5543).totalPrice(52.97f)
.build();
order2.getOrderItems().add(BookOrderItem.builder().orderLine(1).itemNumber(123).build());
order2.getOrderItems().add(BookOrderItem.builder().orderLine(2).itemNumber(456).build());
orders.put(17700L, order2);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.*;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

Expand All @@ -16,7 +17,7 @@ public class BookOrder {
private long orderNumber;
private long customerNumber;
private Date orderDate, shipDate;
@Singular private List<BookOrderItem> orderItems;
private final List<BookOrderItem> orderItems = new ArrayList<>();
private float shippingCost, totalPrice;

}

0 comments on commit 2c4ebfc

Please sign in to comment.