Class ProductOnOrder


  • @Entity
    public class ProductOnOrder
    extends Object
    This is the ProductOnOrder entity class, which declares the attributes needed for products on order which include, id, itemQuantity and the unit price. Two attributes that are annotated @ManyToOne are the Product ID and the Order ID.
    • Constructor Detail

      • ProductOnOrder

        public ProductOnOrder()
    • Method Detail

      • getId

        public Long getId()
        Returns the id
        Returns:
        The ID for the ProductOnOrder.
      • getProduct

        @NonNull
        public Product getProduct()
        Returns the Product id
        Returns:
        The ID of the Product.
      • setProduct

        public void setProduct​(@NonNull
                               Product product)
        Sets Product
        Parameters:
        product - - Product
      • getOrder

        @NonNull
        public Order getOrder()
        Returns the Order id
        Returns:
        The ID of the Order.
      • setOrder

        public void setOrder​(@NonNull
                             Order order)
        Sets Order
        Parameters:
        order - - Order
      • getItemQuantity

        public int getItemQuantity()
        Returns the itemQuantity
        Returns:
        The quantity of the Product on the order.
      • setItemQuantity

        public void setItemQuantity​(int itemQuantity)
        Sets the itemQuantity
        Parameters:
        itemQuantity - - int
      • getUnitPrice

        public int getUnitPrice()
        Returns the unitPrice
        Returns:
        The price for the Product.
      • setUnitPrice

        public void setUnitPrice​(int unitPrice)
        Sets the unitPrice
        Parameters:
        unitPrice - - int