java.lang.Object
com.shr4pnel.db.StockR
com.shr4pnel.db.StockRW
Implements read/write access to the stock database.
- Since:
- v0.1.0
- Author:
- shrapnelnet
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an item to the BasketTablevoidAdds a new order to the OrderTable.voidAdds stock (Re-stocks) to the store.booleanDeletes an order, and all associated basket items from the database to simulate the order being packed.Methods inherited from class com.shr4pnel.db.StockR
getAllOrdersToPack, getAllStock, getConnectionObject
-
Constructor Details
-
StockRW
public StockRW() throws com.shr4pnel.middleware.StockExceptionConstructor for StockRW.
- Throws:
com.shr4pnel.middleware.StockException- if any.
-
-
Method Details
-
addStock
Adds stock (Re-stocks) to the store. Assumed to exist in database.- Parameters:
pNum- Product numberamount- Amount of stock to add
-
addOrder
Adds a new order to the OrderTable.- Parameters:
uuid- A UUID, which is used as a primary key, as well as a foreign key in BasketTable
-
addBasket
Add an item to the BasketTable- Parameters:
orderID- The ID of the order that the item belongs topNum- The Product Number of the itemquantity- The amount of the item to add
-
packOrder
Deletes an order, and all associated basket items from the database to simulate the order being packed.- Parameters:
orderID- The order ID to be removed- Returns:
- true, if successful
-