com.ibm.websphere.samples.plantsbywebsphereejb
Class InventoryBean

java.lang.Object
  extended by com.ibm.websphere.samples.plantsbywebsphereejb.InventoryBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.EntityBean

public abstract class InventoryBean
extends java.lang.Object
implements javax.ejb.EntityBean

InventoryBean is the implementation class for the Inventory entity EJB. InventoryBean 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, InventoryHome, InventoryKey, Serialized Form

Constructor Summary
InventoryBean()
           
 
Method Summary
 int decreaseInventory(int quantity)
          Decrease the quantity of this inventory item.
 void ejbActivate()
          ejbActivate Session EJB lifecycle callback method.
 InventoryKey ejbCreate(InventoryKey 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, int isPublic)
          Create a new Inventory.
 InventoryKey ejbCreate(StoreItem item)
          Create a new Inventory.
 InventoryKey ejbCreate(java.lang.String inventoryID)
          ejbCreate
 void ejbLoad()
          ejbLoad Session EJB lifecycle callback method.
 void ejbPassivate()
          ejbPassivate Session EJB lifecycle callback method.
 void ejbPostCreate(InventoryKey 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, int isPublic)
          Entity EJB lifecycle callback method.
 void ejbPostCreate(StoreItem item)
          Entity EJB lifecycle callback method.
 void ejbPostCreate(java.lang.String inventoryID)
          ejbPostCreate
 void ejbRemove()
          ejbRemove Session EJB lifecycle callback method.
 void ejbStore()
          ejbStore Session EJB lifecycle callback method.
abstract  int getCategory()
          Get the inventory category.
abstract  float getCost()
          Get the inventory item cost.
abstract  java.lang.String getDescription()
          Get the inventory item description.
 javax.ejb.EntityContext getEntityContext()
          getEntityContext
abstract  java.lang.String getHeading()
          Get the inventory item description heading.
 java.lang.String getID()
          Get the inventory ID.
abstract  java.lang.String getImage()
          Get the inventory item image.
abstract  byte[] getImgbytes()
          Get the inventory item image binary data.
abstract  java.lang.String getInventoryID()
          Get the inventory ID.
abstract  int getIsPublic()
           
abstract  int getMaxThreshold()
          Get accessor for persistent attribute: maxThreshold
abstract  int getMinThreshold()
          Get accessor for persistent attribute: minThreshold
abstract  java.lang.String getName()
          Get the inventory item name.
abstract  java.lang.String getNotes()
          Get the notes of inventory in stock.
abstract  java.lang.String getPkginfo()
          Get the inventory item package info.
abstract  float getPrice()
          Get the inventory item price.
abstract  int getQuantity()
          Get the quantity of inventory in stock.
 void increaseInventory(int quantity)
          Increase the quantity of this inventory item.
 boolean isPublic()
          Is this inventory item viewable by the public?
abstract  void setCategory(int category)
          Set the inventory item's category.
abstract  void setCost(float cost)
          Set the inventory item's cost.
abstract  void setDescription(java.lang.String description)
          Set the inventory item's description.
 void setEntityContext(javax.ejb.EntityContext ctx)
          setEntityContext Entity EJB lifecycle callback method to set the EJB entityContext for this EJB.
abstract  void setHeading(java.lang.String heading)
          Set the inventory item's description heading.
abstract  void setImage(java.lang.String image)
          Set the inventory item's image.
abstract  void setImgbytes(byte[] imgbytes)
          Set the inventory item's image binary data.
abstract  void setInventoryID(java.lang.String inventoryID)
          Set the inventory item's ID.
abstract  void setIsPublic(int isPublic)
          Set the inventory item's public flag.
abstract  void setMaxThreshold(int newMaxThreshold)
          Set accessor for persistent attribute: maxThreshold
abstract  void setMinThreshold(int newMinThreshold)
          Set accessor for persistent attribute: minThreshold
abstract  void setName(java.lang.String name)
          Set the inventory item's name.
abstract  void setNotes(java.lang.String notes)
          Set the inventory item's notes.
abstract  void setPkginfo(java.lang.String pkginfo)
          Set the inventory item's package info.
abstract  void setPrice(float price)
          Set the inventory item's price.
 void setPrivacy(boolean isPublic)
          Set the inventory item's public availability.
abstract  void setQuantity(int quantity)
          Set the inventory item's quantity in stock.
 void unsetEntityContext()
          unsetEntityContext Entity EJB lifecycle callback method to unset the EJB entityContext for this EJB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InventoryBean

public InventoryBean()
Method Detail

ejbCreate

public InventoryKey ejbCreate(InventoryKey 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,
                              int isPublic)
                       throws javax.ejb.CreateException
Create a new Inventory.

Parameters:
key - InventoryKey
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.
Throws:
javax.ejb.CreateException

ejbCreate

public InventoryKey ejbCreate(StoreItem item)
                       throws javax.ejb.CreateException
Create a new Inventory.

Parameters:
item - StoreItem to use to make a new inventory item.
Throws:
javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(InventoryKey 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,
                          int isPublic)
Entity EJB lifecycle callback method. This method is empty for this CMP Inventory EJB.


ejbPostCreate

public void ejbPostCreate(StoreItem item)
Entity EJB lifecycle callback method. This method is empty for this CMP Inventory EJB.


getID

public java.lang.String getID()
Get the inventory ID.

Returns:
String The inventory ID.

getInventoryID

public abstract java.lang.String getInventoryID()
Get the inventory ID.

Returns:
String The inventory ID.

getName

public abstract java.lang.String getName()
Get the inventory item name.

Returns:
The inventory item name.

getHeading

public abstract java.lang.String getHeading()
Get the inventory item description heading.

Returns:
The inventory item description heading.

getDescription

public abstract java.lang.String getDescription()
Get the inventory item description.

Returns:
The inventory item description.

getPkginfo

public abstract java.lang.String getPkginfo()
Get the inventory item package info.

Returns:
The inventory item package info.

getImage

public abstract java.lang.String getImage()
Get the inventory item image.

Returns:
The inventory item image.

getImgbytes

public abstract byte[] getImgbytes()
Get the inventory item image binary data.

Returns:
The inventory item image binary data.

getPrice

public abstract float getPrice()
Get the inventory item price.

Returns:
The inventory item price.

getCost

public abstract float getCost()
Get the inventory item cost.

Returns:
The inventory item cost.

getCategory

public abstract int getCategory()
Get the inventory category.

Returns:
The inventory category.

getQuantity

public abstract int getQuantity()
Get the quantity of inventory in stock.

Returns:
The quantity of inventory in stock.

getNotes

public abstract java.lang.String getNotes()
Get the notes of inventory in stock.

Returns:
The inventory notes.

getIsPublic

public abstract int getIsPublic()

isPublic

public boolean isPublic()
Is this inventory item viewable by the public?

Returns:
True, if the public can view this inventory item.

setInventoryID

public abstract void setInventoryID(java.lang.String inventoryID)
Set the inventory item's ID.


setName

public abstract void setName(java.lang.String name)
Set the inventory item's name.


setHeading

public abstract void setHeading(java.lang.String heading)
Set the inventory item's description heading.


setDescription

public abstract void setDescription(java.lang.String description)
Set the inventory item's description.


setPkginfo

public abstract void setPkginfo(java.lang.String pkginfo)
Set the inventory item's package info.


setImage

public abstract void setImage(java.lang.String image)
Set the inventory item's image.


setImgbytes

public abstract void setImgbytes(byte[] imgbytes)
Set the inventory item's image binary data.


setPrice

public abstract void setPrice(float price)
Set the inventory item's price.


setCost

public abstract void setCost(float cost)
Set the inventory item's cost.


setQuantity

public abstract void setQuantity(int quantity)
Set the inventory item's quantity in stock.


setCategory

public abstract void setCategory(int category)
Set the inventory item's category.


setNotes

public abstract void setNotes(java.lang.String notes)
Set the inventory item's notes.


setIsPublic

public abstract void setIsPublic(int isPublic)
Set the inventory item's public flag.


setPrivacy

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


increaseInventory

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

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

decreaseInventory

public int decreaseInventory(int quantity)
Decrease the quantity of this inventory item.

Parameters:
quantity - The number to decrease the inventory by.
Returns:
The number of inventory items removed.

ejbLoad

public void ejbLoad()
ejbLoad Session EJB lifecycle callback method.

Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
ejbStore Session EJB lifecycle callback method.

Specified by:
ejbStore in interface javax.ejb.EntityBean

ejbRemove

public void ejbRemove()
ejbRemove Session EJB lifecycle callback method.

Specified by:
ejbRemove in interface javax.ejb.EntityBean

ejbActivate

public void ejbActivate()
ejbActivate Session EJB lifecycle callback method.

Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
ejbPassivate Session EJB lifecycle callback method.

Specified by:
ejbPassivate in interface javax.ejb.EntityBean

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
setEntityContext Entity EJB lifecycle callback method to set the EJB entityContext for this EJB.

Specified by:
setEntityContext in interface javax.ejb.EntityBean
Parameters:
ctx - javax.ejb.EntityContext The context for this entity EJB.

getEntityContext

public javax.ejb.EntityContext getEntityContext()
getEntityContext


unsetEntityContext

public void unsetEntityContext()
unsetEntityContext Entity EJB lifecycle callback method to unset the EJB entityContext for this EJB.

Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

ejbCreate

public InventoryKey ejbCreate(java.lang.String inventoryID)
                       throws javax.ejb.CreateException
ejbCreate

Throws:
javax.ejb.CreateException

ejbPostCreate

public void ejbPostCreate(java.lang.String inventoryID)
                   throws javax.ejb.CreateException
ejbPostCreate

Throws:
javax.ejb.CreateException

getMinThreshold

public abstract int getMinThreshold()
Get accessor for persistent attribute: minThreshold


setMinThreshold

public abstract void setMinThreshold(int newMinThreshold)
Set accessor for persistent attribute: minThreshold


getMaxThreshold

public abstract int getMaxThreshold()
Get accessor for persistent attribute: maxThreshold


setMaxThreshold

public abstract void setMaxThreshold(int newMaxThreshold)
Set accessor for persistent attribute: maxThreshold