Class OrderService

java.lang.Object
com.esprit.services.products.OrderService
All Implemented Interfaces:
IService<Order>

public class OrderService extends Object implements IService<Order>
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • connection

      private final Connection connection
  • Constructor Details

    • OrderService

      public OrderService()
      Performs OrderService operation.
  • Method Details

    • create

      public void create(Order order)
      Specified by:
      create in interface IService<Order>
    • createOrder

      public Long createOrder(Order order) throws SQLException
      Performs createOrder operation.
      Returns:
      the result of the operation
      Throws:
      SQLException
    • read

      public List<Order> read()
      Specified by:
      read in interface IService<Order>
    • readClientOrders

      public List<Order> readClientOrders()
      Performs readClientOrders operation.
      Returns:
      the result of the operation
    • update

      public void update(Order order)
      Specified by:
      update in interface IService<Order>
    • delete

      public void delete(Order order)
      Specified by:
      delete in interface IService<Order>
    • getOrderById

      public Order getOrderById(int orderId) throws SQLException
      Retrieves the OrderById value.
      Returns:
      the OrderById value
      Throws:
      SQLException
    • getPaidOrders

      public List<Order> getPaidOrders()
      Retrieves the PaidOrders value.
      Returns:
      the PaidOrders value
    • getTop3PurchasedProducts

      public Map<Integer,Integer> getTop3PurchasedProducts()
      Retrieves the Top3PurchasedProducts value.
      Returns:
      the Top3PurchasedProducts value