public class DefaultSubOrderService<O extends SubOrder<O,I>,I extends OrderItem> extends DefaultOrderService<O,I> implements SubOrderService<O,I>
DefaultOrderService
Constructor and Description |
---|
DefaultSubOrderService() |
Modifier and Type | Method and Description |
---|---|
O |
deriveFirst(O order)
|
List<O> |
deriveSequence(Order o)
Get the sequence of Orders; with Root always as first element.
|
O |
ensureSubOrdersChainedInSequence(O nextNew)
Uses
ensureSubOrdersChainedInSequence(SubOrder) to ensure all relations are linked |
Stack<Amount> |
getAllPartialAmounts(O order,
boolean considerOnlyRealizedOrders)
For all Orders placed related to this order, return in sequence all the partial amounts, so far.<
|
SequenceSubOrderTransformer<O> |
getSequenceSubOrderTransformer() |
boolean |
hasAnyDirectRelatedOrders(Order order)
By default check if its
SubOrder type and either has a root or has a SubOrder.getPartialAmount() specified (0 included). |
void |
setSequenceSubOrderTransformer(SequenceSubOrderTransformer<O> sequenceSubOrderTransformer) |
addChangeListener, adjustInventory, checkItemProductsStillLocked, getDao, getListeners, getOrderDao, getPostOrderStrategy, getPreOrderStrategy, isExists, load, lockProductsForOrder, notifyAllListeners, save, save, setListeners, setOrderDao, setPostOrderStrategy, setPreOrderStrategy, unlockProductsForOrder, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adjustInventory, checkItemProductsStillLocked, getDao, isExists, load, lockProductsForOrder, save, save, unlockProductsForOrder, update
addChangeListener, getListeners, notifyAllListeners, setListeners
public O ensureSubOrdersChainedInSequence(O nextNew)
ensureSubOrdersChainedInSequence(SubOrder)
to ensure all relations are linkedensureSubOrdersChainedInSequence
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
nextNew
- as O of type SubOrder
public Stack<Amount> getAllPartialAmounts(O order, boolean considerOnlyRealizedOrders)
getAllPartialAmounts
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
order
- as SubOrder
typeconsiderOnlyRealizedOrders
- as boolean. If true will consider only orders that are realizedAmount
public SequenceSubOrderTransformer<O> getSequenceSubOrderTransformer()
getSequenceSubOrderTransformer
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
#autoCalcPartialAmountForNextSuborder(SubOrder)
public void setSequenceSubOrderTransformer(SequenceSubOrderTransformer<O> sequenceSubOrderTransformer)
setSequenceSubOrderTransformer
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
#autoCalcPartialAmountForNextSuborder(SubOrder)
public O deriveFirst(O order)
deriveFirst
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
order
- as SubOrder
public List<O> deriveSequence(Order o)
deriveSequence
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
o
- as SubOrder
public boolean hasAnyDirectRelatedOrders(Order order)
SubOrder
type and either has a root or has a SubOrder.getPartialAmount()
specified (0 included).hasAnyDirectRelatedOrders
in interface SubOrderService<O extends SubOrder<O,I>,I extends OrderItem>
Copyright © 2018. All rights reserved.