Package org.salespointframework.order
Class OrderLine
java.lang.Object
org.salespointframework.core.AbstractEntity<org.salespointframework.order.OrderLineIdentifier>
org.salespointframework.order.OrderLine
- All Implemented Interfaces:
Persistable<org.salespointframework.order.OrderLineIdentifier>
@Entity public class OrderLine extends AbstractEntity<org.salespointframework.order.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:
ChargeLine
-
Method Summary
Modifier and Type Method Description org.salespointframework.order.OrderLineIdentifier
getId()
javax.money.MonetaryAmount
getPrice()
ProductIdentifier
getProductIdentifier()
String
getProductName()
Quantity
getQuantity()
boolean
refersTo(Product product)
boolean
refersTo(ProductIdentifier identifier)
String
toString()
Methods inherited from class org.salespointframework.core.AbstractEntity
equals, hashCode, hasId, isNew
-
Method Details
-
getId
public org.salespointframework.order.OrderLineIdentifier getId()- Specified by:
getId
in interfacePersistable<org.salespointframework.order.OrderLineIdentifier>
-
refersTo
- Parameters:
product
- must not be null.- Returns:
- Since:
- 7.1
-
refersTo
- Parameters:
identifier
- must not be null.- Returns:
- Since:
- 7.1
-
toString
-
getProductIdentifier
-
getPrice
public javax.money.MonetaryAmount getPrice() -
getQuantity
-
getProductName
-