Class Order


  • @Entity
    public class Order
    extends Object
    This is the Order entity class, which declares the attributes needed for orders. Those include the id, a placedDate and buyer id which is annotated by a ManyToOne from Profile. A @OneToMany annotation for items on order which returns a list of items on order coming from ProductOnOrder.
    • Constructor Detail

      • Order

        public Order()
    • Method Detail

      • getId

        public Long getId()
        Gets the ID for the order.
        Returns:
        The order's ID.
      • getPlacedDate

        @NonNull
        public Date getPlacedDate()
        Gets the creation timestamp for when the order was placed.
        Returns:
        The creation timestamp.
      • getBuyer

        @NonNull
        public Profile getBuyer()
        Gets the buying Profile.
        Returns:
        The Profile that placed the order.
      • setBuyer

        public void setBuyer​(@NonNull
                             Profile buyer)
        Sets buyer
        Parameters:
        buyer - - Profile
      • getItemsOnOrder

        @NonNull
        public List<ProductOnOrder> getItemsOnOrder()
        Gets the items on the order.
        Returns:
        List of itemsOnOrder