|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--theory.smart.foundation.EntityImpl | +--theory.smart.ebusiness.order.OrderImpl
The Order class collects OrderLines and provides indirect access to the Items they contain. An OrderLine is an Item and the quantity that the customer intends to by. It is the conceptual equivalent of a shopping cart or basket. The order combines the features of a list and a map. It is a list so that the positioning of the items in the order is preserved. The Order is responsible for ensuring that each item appears only once in the list and for adjusting the quantity as necessary.. When an Item is added to an Order an OrderLine is created. If an OrderLine for that Item already exists its quantity is adjusted..
Primary Key = theory.smart.ebusiness.order.OrderPk
Order
,
OrderHome
,
OrderValue
, Serialized FormField Summary | |
SmartHandle |
customer
customer [Order] <>------> [ theory.smart.ebusiness.customer.Customer ]
|
java.lang.String |
key
key [Order] <*>------> [ String ] (Primary Key)
|
com.sun.java.util.collections.LinkedList |
orderLines
orderLine (List) [Order] <*>------> [ theory.smart.ebusiness.order.OrderLine ]
0..*
|
WorkflowContext |
status
status [Order] <*>------> [ theory.smart.ebusiness.order.OrderWorkflow ]
|
Workflow |
statusWorkflow
|
Fields inherited from class theory.smart.foundation.EntityImpl |
ctx,
isDirty,
isLoaded |
Constructor Summary | |
OrderImpl()
|
Method Summary | |
void |
addFirstOrderLine(OrderLine orderLine)
Inserts the given orderLine at the beginning of the orderLine list. |
void |
addItem(Item item,
Quantity quantity)
Add an Item to this Order. |
void |
addItems(Order items)
Add the OrderLines from the specified order to this order. |
void |
addLastOrderLine(OrderLine orderLine)
Appends the given orderLine to the end of the orderLine list. |
void |
addOrderLine(int index,
OrderLine orderLine)
Inserts the specified orderLine at the specified position in the orderLine list. |
boolean |
addOrderLine(OrderLine orderLine)
Appends the specified orderLine to the end of the orderLine list. |
boolean |
addOrderLines(int index,
com.sun.java.util.collections.LinkedList orderLines)
Inserts all of the orderLines in the specified collection into this list, starting at the specified position. |
boolean |
addOrderLines(com.sun.java.util.collections.LinkedList orderLines)
Appends all of the orderLines in the specified collection to the end of the orderLine list, in the order that they are returned by the specified collection's iterator. |
void |
cancel()
Apply the "cancel" transition to the OrderWorkflow . |
boolean |
containsOrderLine(OrderLine orderLine)
Returns true if the orderLine list contains the specified element. |
void |
ejbActivate()
ejbActivate method. |
OrderPk |
ejbCreate(OrderPk orderPk)
|
java.util.Enumeration |
ejbFindAll()
|
OrderPk |
ejbFindByPrimaryKey(OrderPk pk)
|
void |
ejbLoad()
ejbLoad method. |
void |
ejbPassivate()
ejbPassivate method. |
void |
ejbPostCreate(OrderPk orderPk)
|
void |
ejbRemove()
ejbRemove method. |
void |
ejbStore()
ejbStore method. |
void |
finalizePrices()
Iterate the order lines and "lockin" the price of each. |
OrderLine |
findOrderLine(Item item)
Find the order line associated with the specified Item. |
Customer |
getCustomer()
Get the remote object reference of customer |
OrderLine |
getFirstOrderLine()
Returns the first orderLine in the orderLine list. |
com.sun.java.util.collections.Collection |
getItems()
Retrieves a list of the Items that are included in this order. |
java.lang.String |
getKey()
|
OrderLine |
getLastOrderLine()
Returns the last orderLine in the orderLine list. |
int |
getNumberOfOrderLines()
Returns the number of orderLines in the orderLine list. |
Quantity |
getNumberOfUnits()
Count the total quantity of items by summing the quantity on each line. |
OrderValue |
getOrderByValue()
Get all of Order's attributes. |
OrderLine |
getOrderLine(int index)
Returns the orderLine at the specified position in the orderLine list. |
com.sun.java.util.collections.LinkedList |
getOrderLines()
Returns all of the orderLines in the orderLine list. |
com.sun.java.util.collections.LinkedList |
getOrderLines(int fromIndex,
int toIndex)
Returns a view of the portion of the orderLine list between fromIndex, inclusive, and toIndex, exclusive. |
java.lang.String |
getOrderPriceCalculationPolicyName()
Return the name of the business policy that will be used when calculating the orders total price. |
java.lang.String |
getStatus()
Returns the current state name of the theory.smart.ebusiness.order.OrderWorkflow workflow |
Price |
getTotalPrice()
Calculate the price of the order by iterating the OrderLines and summing the line prices. |
int |
indexOfOrderLine(OrderLine orderLine)
Returns the index in the orderLine list of the first occurrence of the specified element, or -1 if the orderLine list does not contain this element. |
void |
invoice()
Apply the "Invoice" transition to the OrderWorkflow . |
boolean |
isOrderLinesEmtpy()
Returns true if the orderLine list contains no orderLines. |
int |
lastIndexOfOrderLine(OrderLine orderLine)
Returns the index in the orderLine list of the last occurrence of the specified element, or -1 if the orderLine list does not contain this element. |
void |
removeAllItems()
Removes all OrderLines. |
void |
removeAllOrderLines()
Removes all of the orderLines from the orderLine list. |
OrderLine |
removeFirstOrderLine()
Removes and returns the first orderLine from the orderLine list. |
void |
removeItem(Item item)
Remove the OrderLine associated with the Item specified. |
OrderLine |
removeLastOrderLine()
Removes and returns the last orderLine from the orderLine list. |
OrderLine |
removeOrderLine(int index)
Removes the orderLine at the specified position in the orderLine list. |
boolean |
removeOrderLine(OrderLine orderLine)
Removes the first occurrence of the specified orderLine in the orderLine list. |
void |
returnOrder()
Apply the "returnOrder" transition to the OrderWorkflow . |
void |
sendToShipping()
Apply the "sendToShipping" transition to the OrderWorkflow . |
void |
setCustomer(Customer customer)
Set the remote object reference of customer |
void |
setEntityContext(javax.ejb.EntityContext ctx)
setEntityContext method. |
void |
setItemQuantity(Item item,
Quantity n)
Sets the Quantity of the OrderLine associated with this Item. |
void |
setOrderByValue(OrderValue value)
Set all of Order's attributes to the passed in value. |
OrderLine |
setOrderLine(int index,
OrderLine orderLine)
Replaces the orderLine at the specified position in the orderLine list with the specified element. |
void |
ship()
Apply the "ship" transition to the OrderWorkflow . |
void |
unsetEntityContext()
unsetEntityContext method. |
Methods inherited from class theory.smart.foundation.EntityImpl |
ejbCreate,
ejbPostCreate,
getEntityContext,
isModified |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public java.lang.String key
key
[Order] <*>------> [String
] (Primary Key)
public com.sun.java.util.collections.LinkedList orderLines
orderLine (List)
[Order] <*>------> [theory.smart.ebusiness.order.OrderLine
]
0..*
public WorkflowContext status
status
[Order] <*>------> [theory.smart.ebusiness.order.OrderWorkflow
]
public transient Workflow statusWorkflow
public SmartHandle customer
customer
[Order] <>------> [theory.smart.ebusiness.customer.Customer
]
Constructor Detail |
public OrderImpl() throws javax.ejb.CreateException
Method Detail |
public OrderValue getOrderByValue() throws java.rmi.RemoteException
public void setOrderByValue(OrderValue value) throws java.rmi.RemoteException
OrderValue
- the Order value objectpublic OrderPk ejbCreate(OrderPk orderPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbPostCreate(OrderPk orderPk) throws javax.ejb.CreateException, java.rmi.RemoteException
public void ejbLoad() throws java.rmi.RemoteException
public void ejbStore() throws java.rmi.RemoteException
public void ejbRemove() throws java.rmi.RemoteException, javax.ejb.RemoveException
public void ejbActivate() throws java.rmi.RemoteException
public void ejbPassivate() throws java.rmi.RemoteException
public void setEntityContext(javax.ejb.EntityContext ctx) throws java.rmi.RemoteException
public void unsetEntityContext() throws java.rmi.RemoteException
public OrderPk ejbFindByPrimaryKey(OrderPk pk) throws javax.ejb.FinderException, java.rmi.RemoteException
public java.util.Enumeration ejbFindAll() throws javax.ejb.FinderException, java.rmi.RemoteException
public java.lang.String getKey() throws java.rmi.RemoteException
public void addOrderLine(int index, OrderLine orderLine)
index
- index at which the specified orderLine is to be inserted.orderLine
- orderLine to be inserted.public boolean addOrderLine(OrderLine orderLine)
orderLine
- orderLine to be appended to the orderLine list.public boolean addOrderLines(int index, com.sun.java.util.collections.LinkedList orderLines)
index
- index at which to insert first element
from the specified collection.orderLines
- orderLines to be inserted into the orderLine list.public boolean addOrderLines(com.sun.java.util.collections.LinkedList orderLines)
orderLines
- orderLines to be inserted into the orderLine list.public void addFirstOrderLine(OrderLine orderLine)
public void addLastOrderLine(OrderLine orderLine)
public boolean containsOrderLine(OrderLine orderLine)
orderLine
- orderLine whose presence in the orderLine list is to be tested.public OrderLine getOrderLine(int index)
index
- index of orderLine to return.public com.sun.java.util.collections.LinkedList getOrderLines(int fromIndex, int toIndex)
fromIndex
- low endpoint (inclusive) of the subList.toKey
- high endpoint (exclusive) of the subList.public com.sun.java.util.collections.LinkedList getOrderLines()
public OrderLine getFirstOrderLine()
public OrderLine getLastOrderLine()
public int getNumberOfOrderLines()
public int indexOfOrderLine(OrderLine orderLine)
orderLine
- orderLine to search for.public boolean isOrderLinesEmtpy()
public int lastIndexOfOrderLine(OrderLine orderLine)
orderLine
- orderLine to search for.public void removeAllOrderLines()
public OrderLine removeOrderLine(int index)
index
- the index of the orderLine to removed.public boolean removeOrderLine(OrderLine orderLine)
orderLine
- orderLine to be removed from the orderLine list, if present.public OrderLine removeFirstOrderLine()
public OrderLine removeLastOrderLine()
public OrderLine setOrderLine(int index, OrderLine orderLine)
index
- index of orderLine to replace.orderLine
- orderLine to be stored at the specified position.public java.lang.String getStatus()
public Customer getCustomer() throws java.rmi.RemoteException
public void setCustomer(Customer customer) throws java.rmi.RemoteException
customers
- customer to be addedpublic void addItems(Order items) throws java.rmi.RemoteException
public void addItem(Item item, Quantity quantity) throws java.rmi.RemoteException
public com.sun.java.util.collections.Collection getItems() throws java.rmi.RemoteException
public Quantity getNumberOfUnits() throws java.rmi.RemoteException
public void setItemQuantity(Item item, Quantity n) throws java.rmi.RemoteException
public void removeItem(Item item) throws java.rmi.RemoteException
public void removeAllItems() throws java.rmi.RemoteException
public Price getTotalPrice() throws java.rmi.RemoteException
public OrderLine findOrderLine(Item item) throws java.rmi.RemoteException, javax.ejb.FinderException
public void invoice() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs when the order has been accepted by the customer and needs to be delivered to billing.public void sendToShipping() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs once the order has been recorded with billing.public void ship() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs once the order has been succesfully processed by shipping.public void returnOrder() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This occurs when an item is returned to inventory.public void cancel() throws java.rmi.RemoteException, IllegalWorkflowTransitionException
OrderWorkflow
. This when the order has been invoiced but before it has been shipped.public void finalizePrices() throws java.rmi.RemoteException
public java.lang.String getOrderPriceCalculationPolicyName() throws java.rmi.RemoteException
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |