Class OrderLine

java.lang.Object
org.salespointframework.core.AbstractEntity<org.salespointframework.order.OrderLine.OrderLineIdentifier>
org.salespointframework.order.OrderLine
All Implemented Interfaces:
Persistable<org.salespointframework.order.OrderLine.OrderLineIdentifier>

@Entity public class OrderLine extends AbstractEntity<org.salespointframework.order.OrderLine.OrderLineIdentifier>
An order line represents the price and the Quantity of a Product that is intended to be purchased as part of an Order.

Order lines should not be used to represent expenses for services, such as shipping. For this purpose, ChargeLine should be used instead.

Note that the constructor of this class creates a copy of the product's name and price, so that changes to those attributes do not affect existing orders.

Author:
Paul Henke, Oliver Gierke
See Also:
  • Method Details

    • getId

      public org.salespointframework.order.OrderLine.OrderLineIdentifier getId()
      Returns the unique identifier of this OrderLine.
      Specified by:
      getId in interface Persistable<org.salespointframework.order.OrderLine.OrderLineIdentifier>
      Returns:
      will never be null
    • refersTo

      public boolean refersTo(Product product)
      Returns whether the OrderLine refers to the given Product.
      Parameters:
      product - must not be null.
      Returns:
      Since:
      7.1
    • refersTo

      public boolean refersTo(Product.ProductIdentifier identifier)
      Returns whether the OrderLine refers to the Product with the given identifier.
      Parameters:
      identifier - must not be null.
      Returns:
      Since:
      7.1
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getProductIdentifier

      public Product.ProductIdentifier getProductIdentifier()
    • getPrice

      public javax.money.MonetaryAmount getPrice()
    • getQuantity

      public Quantity getQuantity()
    • getProductName

      public String getProductName()