SalesPoint v3.3 API

data.ooimpl
Class CountingStockItemDBEntry

java.lang.Object
  extended by data.ooimpl.DataBasketEntryImpl<Object>
      extended by data.ooimpl.StockItemDBEntry
          extended by data.ooimpl.CountingStockItemDBEntry
All Implemented Interfaces:
DataBasketEntry<Object>, DataBasketKeys, Serializable, Loggable

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
Author:
Steffen Zschaler
See Also:
Serialized Form

Nested Class Summary
static class CountingStockItemDBEntry.CSDBELogEntry
          LogEntry describing an operation on CountingStock StockItem's.
 
Nested classes/interfaces inherited from class data.ooimpl.StockItemDBEntry
StockItemDBEntry.StockItemDBELogEntry
 
Field Summary
 
Fields inherited from class data.ooimpl.DataBasketEntryImpl
m_dbedDest, m_dbesSource, m_dbiOwner, m_fHandled, m_oValue, m_sMainKey, m_sSecondaryKey
 
Fields inherited from interface data.DataBasketKeys
CATALOG_ITEM_MAIN_KEY, STOCK_ITEM_MAIN_KEY
 
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.

Overrides:
count in class StockItemDBEntry
Returns:
the number of affected items.
Override:
Never

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.

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

getLogData

public LogEntry getLogData()
Create and return a LogEntry describing this DataBasketEntry.

Specified by:
getLogData in interface Loggable
Overrides:
getLogData in class StockItemDBEntry
Returns:
the data to be stored in the log file.
Override:
Sometimes

SalesPoint v3.3 API