Class OrderService

java.lang.Object
org.mybatis.jpetstore.service.OrderService

@Service public class OrderService extends Object
The Class OrderService.
Author:
Eduardo Macarron
  • Constructor Details

    • OrderService

      public OrderService(ItemMapper itemMapper, OrderMapper orderMapper, SequenceMapper sequenceMapper, LineItemMapper lineItemMapper)
      Instantiates a new order service.
      Parameters:
      itemMapper - the item mapper
      orderMapper - the order mapper
      sequenceMapper - the sequence mapper
      lineItemMapper - the line item mapper
  • Method Details

    • insertOrder

      @Transactional public void insertOrder(Order order)
      Insert order.
      Parameters:
      order - the order
    • getOrder

      @Transactional public Order getOrder(int orderId)
      Gets the order.
      Parameters:
      orderId - the order id
      Returns:
      the order
    • getOrdersByUsername

      public List<Order> getOrdersByUsername(String username)
      Gets the orders by username.
      Parameters:
      username - the username
      Returns:
      the orders by username
    • getNextId

      public int getNextId(String name)
      Gets the next id.
      Parameters:
      name - the name
      Returns:
      the next id