org.cocome.tradingsystem.inventory.data.store
Interface StoreQueryIf

All Known Implementing Classes:
StoreQueryImpl

public interface StoreQueryIf

This interface provides methods for querying the database. The interface will be used by the InventoryApplication. The methods are derived from methods defined in StoreIf and CashdeskIf.

Author:
Yannick Welsch

Method Summary
 java.util.Collection<StockItem> getStockItems(long storeId, long[] productIds, PersistenceContext pctx)
           
 java.util.Collection<StockItem> queryAllStockItems(long storeId, PersistenceContext pctx)
           
 java.util.Collection<StockItem> queryLowStockItems(long storeId, PersistenceContext pctx)
          queries the stockitems which are low on stock
 ProductOrder queryOrderById(long orderId, PersistenceContext pctx)
          The following methods from StoreIf use this method: List orderProducts(ComplexOrderTO complexOrder, StoreTO storeTO); ComplexOrderTO getOrder(int orderId); void rollInReceivedOrder(ComplexOrderTO complexOrder, StoreTO store);
 Product queryProductById(long productId, PersistenceContext pctx)
           
 java.util.Collection<Product> queryProducts(long storeId, PersistenceContext pctx)
           
 StockItem queryStockItem(long storeId, long productbarcode, PersistenceContext pctx)
          The following methods from StoreIf use this method: ProductWithStockItemTO getProductWithStockItem(int productBarCode);
 StockItem queryStockItemById(long stockId, PersistenceContext pctx)
           
 Store queryStoreById(long storeId, PersistenceContext pctx)
           
 

Method Detail

queryStoreById

Store queryStoreById(long storeId,
                     PersistenceContext pctx)
Parameters:
storeId - A unique identifier of a Store object
pctx - the persistence context
Returns:
A Store object which has the the specified id

queryProducts

java.util.Collection<Product> queryProducts(long storeId,
                                            PersistenceContext pctx)
Parameters:
storeId - A unique identifier of a Store object
pctx - the persistence context
Returns:
The products owned by this store

queryLowStockItems

java.util.Collection<StockItem> queryLowStockItems(long storeId,
                                                   PersistenceContext pctx)
queries the stockitems which are low on stock

Parameters:
storeId - A unique identifier of a Store object
pctx - the persistence context
Returns:
A list of StockItem objects

queryAllStockItems

java.util.Collection<StockItem> queryAllStockItems(long storeId,
                                                   PersistenceContext pctx)
Parameters:
storeId - A unique identifier of a Store object
pctx - the persistence context
Returns:
A list of StockItem objects

queryOrderById

ProductOrder queryOrderById(long orderId,
                            PersistenceContext pctx)
The following methods from StoreIf use this method: List orderProducts(ComplexOrderTO complexOrder, StoreTO storeTO); ComplexOrderTO getOrder(int orderId); void rollInReceivedOrder(ComplexOrderTO complexOrder, StoreTO store);

Parameters:
orderId - A unique identifier of an ProductOrder object
pctx - the persistence context
Returns:
An ProductOrder object which has the specified id

queryStockItem

StockItem queryStockItem(long storeId,
                         long productbarcode,
                         PersistenceContext pctx)
The following methods from StoreIf use this method: ProductWithStockItemTO getProductWithStockItem(int productBarCode);

Parameters:
storeId - A unique identifier of a Store object
productbarcode -
pctx - the persistence context
Returns:
the stockitem from the Store with storeId and being of product type with barcode productbarcode. Return null if the product was not found in the store.

queryStockItemById

StockItem queryStockItemById(long stockId,
                             PersistenceContext pctx)
Parameters:
stockId - A unique identifier of a StockItem object
pctx -
Returns:
the StockItem which has this id

queryProductById

Product queryProductById(long productId,
                         PersistenceContext pctx)
Parameters:
productId - A unique identifier of a Product object
pctx - the persistence context
Returns:
the Product which has this id

getStockItems

java.util.Collection<StockItem> getStockItems(long storeId,
                                              long[] productIds,
                                              PersistenceContext pctx)
Parameters:
storeId - The store to search StockItems for.
productIds - The products to look up in the stock
pctx - the persistence context
Returns:
The products as StockItems (including amounts)