- Create models
- Order
- Create DAO
- OrderDao. To get the order for a specific user create the method getByUser().
- Create service
- OrderService
public interface OrderService { Order completeOrder(ShoppingCart shoppingCart); List<Order> getOrdersHistory(User user); }
- OrderService
- In the
mate/academy/Main.main()
method create an instance of OrderService using injector and test all methods from it.
Attention!!!: you can have some problems with the naming of the table. Let's use orders
instead of order
.
You can check yourself using this checklist