SalesPoint Framework v3.0

data.ooimpl
Class CountingStockItemDBEntry

java.lang.Object
  |
  +--data.ooimpl.DataBasketEntryImpl
        |
        +--data.ooimpl.StockItemDBEntry
              |
              +--data.ooimpl.CountingStockItemDBEntry

public class CountingStockItemDBEntry
extends StockItemDBEntry

DataBasketEntry describing operations with CountingStock's items. The fields of the DataBasketEntry are set as follows:

FieldValue
main key STOCK_ITEM_MAIN_KEY
secondary key name of the StockItem in question
source source stock
destination destination stock
value an Integer representing the number of StockItems that were moved.

Since:
v2.0
Version:
2.0 19/08/1999
Author:
Steffen Zschaler
See Also:
Serialized Form

Inner Class Summary
static class CountingStockItemDBEntry.CSDBELogEntry
          LogEntry describing an operation on CountingStock StockItem's.
 
Inner classes inherited from class data.ooimpl.StockItemDBEntry
StockItemDBEntry.StockItemDBELogEntry
 
Fields inherited from class data.ooimpl.DataBasketEntryImpl
m_dbedDest, m_dbesSource, m_dbiOwner, m_fHandled, m_oValue, m_sMainKey, m_sSecondaryKey
 
Constructor Summary
CountingStockItemDBEntry(String sKey, StockImpl stiSource, StockImpl stiDest, int nCount)
          Create a new CountingStockItemDBEntry.
 
Method Summary
 int count()
          Count the affected items.
 LogEntry getLogData()
          Create and return a LogEntry describing this DataBasketEntry.
 void partialRollback(int nCount)
          Rollback the operation described by this DataBasketEntry for a given number of items.
 
Methods inherited from class data.ooimpl.DataBasketEntryImpl
commit, getDestination, getMainKey, getOwner, getSecondaryKey, getSource, getValue, isHandled, rollback, setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingStockItemDBEntry

public CountingStockItemDBEntry(String sKey,
                                StockImpl stiSource,
                                StockImpl stiDest,
                                int nCount)
Create a new CountingStockItemDBEntry.
Parameters:
sKey - the affected key.
stiSource - the source Stock.
stiDest - the destination Stock.
nCount - the number of affected items. This will be stored as the value attribute of the DataBasketEntry.
Method Detail

count

public int count()
Count the affected items.
Override:
Never.
Returns:
the number of affected items.
Overrides:
count in class StockItemDBEntry

partialRollback

public void partialRollback(int nCount)
Rollback the operation described by this DataBasketEntry for a given number of items.

The method will rollback the operation for the given number of items, updating the underlying DataBasket correctly.

Attention: The method is public as an implementation detail and should not be called directly.

Override:
Never.
Parameters:
nCount - the number of items for which to rollback the operation.
Throws:
IllegalArgumentException - if nCount >= count().

getLogData

public LogEntry getLogData()
Create and return a LogEntry describing this DataBasketEntry.
Override:
Sometimes.
Overrides:
getLogData in class StockItemDBEntry

SalesPoint Framework v3.0