com.ibm.websphere.samples.plantsbywebsphereejb
Class Inventory

java.lang.Object
  extended by com.ibm.websphere.samples.plantsbywebsphereejb.Inventory
All Implemented Interfaces:
java.io.Serializable

public class Inventory
extends java.lang.Object
implements java.io.Serializable

Inventory is the implementation class for the Inventory entity EJB. Inventory implements each of the business methods in the Inventory EJB local interface and each of the EJB lifecycle methods in the javax.ejb.EntityBean interface.

See Also:
Inventory, Serialized Form

Constructor Summary
Inventory()
           
Inventory(Inventory item)
          Create a new Inventory.
Inventory(StoreItem item)
          Create a new Inventory based on values from the StoreItem
Inventory(java.lang.String key, java.lang.String name, java.lang.String heading, java.lang.String desc, java.lang.String pkginfo, java.lang.String image, float price, float cost, int quantity, int category, java.lang.String notes, boolean isPublic)
          Create a new Inventory.
 
Method Summary
 BackOrder getBackOrder()
           
 int getCategory()
           
 float getCost()
           
 java.lang.String getDescription()
           
 java.lang.String getHeading()
           
 java.lang.String getID()
          Same as getInventoryId.
 java.lang.String getImage()
           
 byte[] getImgbytes()
           
 java.lang.String getInventoryId()
           
 int getMaxThreshold()
           
 int getMinThreshold()
           
 java.lang.String getName()
           
 java.lang.String getNotes()
           
 java.lang.String getPkginfo()
           
 float getPrice()
           
 int getQuantity()
           
 void increaseInventory(int quantity)
          Increase the quantity of this inventory item.
 boolean isPublic()
           
 void setBackOrder(BackOrder backOrder)
           
 void setCategory(int category)
           
 void setCost(float cost)
           
 void setDescription(java.lang.String description)
           
 void setHeading(java.lang.String heading)
           
 void setID(java.lang.String id)
          Same as setInventoryId.
 void setImage(java.lang.String image)
           
 void setImgbytes(byte[] imgbytes)
           
 void setInventoryId(java.lang.String id)
           
 void setIsPublic(boolean isPublic)
           
 void setMaxThreshold(int maxThreshold)
           
 void setMinThreshold(int minThreshold)
           
 void setName(java.lang.String name)
           
 void setNotes(java.lang.String notes)
           
 void setPkginfo(java.lang.String pkginfo)
           
 void setPrice(float price)
           
 void setPrivacy(boolean isPublic)
          Set the inventory item's public availability.
 void setQuantity(int quantity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inventory

public Inventory()

Inventory

public Inventory(java.lang.String key,
                 java.lang.String name,
                 java.lang.String heading,
                 java.lang.String desc,
                 java.lang.String pkginfo,
                 java.lang.String image,
                 float price,
                 float cost,
                 int quantity,
                 int category,
                 java.lang.String notes,
                 boolean isPublic)
Create a new Inventory.

Parameters:
key - Inventory Key
name - Name of inventory item.
heading - Description heading of inventory item.
desc - Description of inventory item.
pkginfo - Package info of inventory item.
image - Image of inventory item.
price - Price of inventory item.
cost - Cost of inventory item.
quantity - Quantity of inventory items in stock.
category - Category of inventory item.
notes - Notes of inventory item.
isPublic - Access permission of inventory item.

Inventory

public Inventory(StoreItem item)
Create a new Inventory based on values from the StoreItem

Parameters:
StoreItem -

Inventory

public Inventory(Inventory item)
Create a new Inventory.

Parameters:
item - Inventory to use to make a new inventory item.
Method Detail

increaseInventory

public void increaseInventory(int quantity)
Increase the quantity of this inventory item.

Parameters:
quantity - The number to increase the inventory by.

getCategory

public int getCategory()

setCategory

public void setCategory(int category)

getCost

public float getCost()

setCost

public void setCost(float cost)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getHeading

public java.lang.String getHeading()

setHeading

public void setHeading(java.lang.String heading)

getImage

public java.lang.String getImage()

setImage

public void setImage(java.lang.String image)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getNotes

public java.lang.String getNotes()

setNotes

public void setNotes(java.lang.String notes)

getPkginfo

public java.lang.String getPkginfo()

setPkginfo

public void setPkginfo(java.lang.String pkginfo)

getPrice

public float getPrice()

setPrice

public void setPrice(float price)

getQuantity

public int getQuantity()

setQuantity

public void setQuantity(int quantity)

getMaxThreshold

public int getMaxThreshold()

setMaxThreshold

public void setMaxThreshold(int maxThreshold)

getMinThreshold

public int getMinThreshold()

setMinThreshold

public void setMinThreshold(int minThreshold)

getInventoryId

public java.lang.String getInventoryId()

setInventoryId

public void setInventoryId(java.lang.String id)

getID

public java.lang.String getID()
Same as getInventoryId. Added for compatability with ShoppingCartItem when used by the Client XJB sample

Returns:

setID

public void setID(java.lang.String id)
Same as setInventoryId. Added for compatability with ShoppingCartItem when used by the Client XJB sample


isPublic

public boolean isPublic()

setIsPublic

public void setIsPublic(boolean isPublic)

setPrivacy

public void setPrivacy(boolean isPublic)
Set the inventory item's public availability.


getImgbytes

public byte[] getImgbytes()

setImgbytes

public void setImgbytes(byte[] imgbytes)

getBackOrder

public BackOrder getBackOrder()

setBackOrder

public void setBackOrder(BackOrder backOrder)