com.ibm.websphere.samples.ejbquery.employeefinderejb
Class DeptBean

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

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

The DeptBean CMP EJB Bean implements the EntityBean interface. It contains the accessor and business methods necessary to work with an Dept. In addition, it contains the Home Interface Methods, and Callback Methods.

See Also:
Serialized Form

Field Summary
protected  javax.ejb.EntityContext entityContext
           
 
Constructor Summary
DeptBean()
           
 
Method Summary
 int add1()
          add1 method returns deptno + 1.
 void ejbActivate()
          ejbActivate required callback method for lifecycle notification.
 DeptKey ejbCreate(java.lang.Integer deptno)
          ejbCreate method responsible for the creation of a skeleton Dept.
 DeptKey ejbCreate(java.lang.Integer deptno, java.lang.String name, double budget)
          ejbCreate method responsible for the creation of a Dept.
 void ejbLoad()
          ejbLoad required callback method gets called after the EJB is loaded from the database.
 void ejbPassivate()
          ejbPassivate required callback method for lifecycle notification.
 void ejbPostCreate(DeptKey key)
          ejbPostCreate Home Interface Method responsible for post creation steps, there are none for Dept.
 void ejbPostCreate(java.lang.Integer deptno)
          ejbPostCreate method responsible for the post creation of a skeleton Dept.
 void ejbPostCreate(java.lang.Integer deptno, java.lang.String name, double budget)
          ejbPostCreate method responsible for the post creation of a Dept.
 void ejbRemove()
          ejbRemove required callback method for Contaimer Managed Persistence.
 void ejbStore()
          ejbStore required callback method for Contaimer Managed Persistence.
abstract  double getBudget()
          This abstract CMP field accessor method gets the budget attribute.
abstract  java.lang.Integer getDeptno()
          This abstract CMP field accessor method gets the deptno attribute.
abstract  java.util.Collection getEmps()
          This abstract CMR field accessor method gets the emps attribute.
abstract  EmpLocal getMgr()
          This abstract CMR field accessor method gets the mgr attribute.
abstract  java.lang.String getName()
          This abstract CMP field accessor method gets the name attribute.
abstract  void setBudget(double budget)
          This abstract CMP field accessor method sets the budget attribute.
abstract  void setDeptno(java.lang.Integer deptno)
          This abstract CMP field accessor method sets the deptno attribute.
abstract  void setEmps(java.util.Collection newEmps)
          This abstract CMR field accessor method sets the emps attribute.
 void setEntityContext(javax.ejb.EntityContext ctx)
          setEntityContext required callback method for Container Managed Persistence.
abstract  void setMgr(EmpLocal newMgr)
          This abstract CMR field accessor method sets the mgr attribute.
abstract  void setName(java.lang.String name)
          This abstract CMP field accessor method sets the name attribute.
 void unsetEntityContext()
          unsetEntityContext required callback method for Container Managed Persistence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityContext

protected javax.ejb.EntityContext entityContext
Constructor Detail

DeptBean

public DeptBean()
Method Detail

getDeptno

public abstract java.lang.Integer getDeptno()
This abstract CMP field accessor method gets the deptno attribute.

Returns:
java.lang.Integer

setDeptno

public abstract void setDeptno(java.lang.Integer deptno)
This abstract CMP field accessor method sets the deptno attribute.

Parameters:
deptno - java.lang.Integer

getName

public abstract java.lang.String getName()
This abstract CMP field accessor method gets the name attribute.

Returns:
java.lang.String

setName

public abstract void setName(java.lang.String name)
This abstract CMP field accessor method sets the name attribute.

Parameters:
name - java.lang.String

getBudget

public abstract double getBudget()
This abstract CMP field accessor method gets the budget attribute.

Returns:
double

setBudget

public abstract void setBudget(double budget)
This abstract CMP field accessor method sets the budget attribute.

Parameters:
budget - double

getEmps

public abstract java.util.Collection getEmps()
This abstract CMR field accessor method gets the emps attribute. returns the Collection of emps in a dept

Returns:
java.util.Collection

setEmps

public abstract void setEmps(java.util.Collection newEmps)
This abstract CMR field accessor method sets the emps attribute.

Parameters:
newEmps - java.util.Collection

getMgr

public abstract EmpLocal getMgr()
This abstract CMR field accessor method gets the mgr attribute.

Returns:
EmpLocal

setMgr

public abstract void setMgr(EmpLocal newMgr)
This abstract CMR field accessor method sets the mgr attribute.

Parameters:
newMgr - EmpLocal

add1

public int add1()
add1 method returns deptno + 1.

eg. select e.add1() from DeptBean e
WARNING.  For methods to work, the server's "Application classloader policy" must be set to "Single". The default is "Multiple" which can be reset using the Administrative Console.

Returns:
int

ejbCreate

public DeptKey ejbCreate(java.lang.Integer deptno)
                  throws javax.ejb.CreateException
ejbCreate method responsible for the creation of a skeleton Dept.

Parameters:
deptno - java.lang.Integer
Returns:
DeptKey the Primary Key Object for Dept, it must be unique.
Throws:
javax.ejb.CreateException - This exception is thrown to indicate a failure to create the entity EJB.

ejbCreate

public DeptKey ejbCreate(java.lang.Integer deptno,
                         java.lang.String name,
                         double budget)
                  throws javax.ejb.CreateException
ejbCreate method responsible for the creation of a Dept.

Parameters:
deptno - java.lang.Integer
name - java.lang.String
budget - double
Returns:
DeptKey the Primary Key Object for Dept, it must be unique.
Throws:
javax.ejb.CreateException - This exception is thrown to indicate a failure to create the entity EJB.

ejbPostCreate

public void ejbPostCreate(java.lang.Integer deptno)
                   throws javax.ejb.CreateException
ejbPostCreate method responsible for the post creation of a skeleton Dept.

Parameters:
deptno - java.lang.Integer
Throws:
javax.ejb.CreateException - This exception is thrown to indicate a failure to create the entity EJB.

ejbPostCreate

public void ejbPostCreate(java.lang.Integer deptno,
                          java.lang.String name,
                          double budget)
                   throws javax.ejb.CreateException
ejbPostCreate method responsible for the post creation of a Dept.

Parameters:
deptno - java.lang.Integer
name - java.lang.String
budget - double
Throws:
javax.ejb.CreateException - This exception is thrown to indicate a failure to create the entity EJB.

ejbPostCreate

public void ejbPostCreate(DeptKey key)
                   throws javax.ejb.CreateException
ejbPostCreate Home Interface Method responsible for post creation steps, there are none for Dept.

Parameters:
key - DeptKey
Throws:
javax.ejb.CreateException - This exception is thrown to indicate a failure to create the entity EJB.

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException
setEntityContext required callback method for Container Managed Persistence.

Specified by:
setEntityContext in interface javax.ejb.EntityBean
Parameters:
ctx - javax.ejb.EntityContext
Throws:
javax.ejb.EJBException - This exception is thrown to indicate a failure to create the entity EJB.

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException
unsetEntityContext required callback method for Container Managed Persistence.

Specified by:
unsetEntityContext in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - The exception description.

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException
ejbLoad required callback method gets called after the EJB is loaded from the database.

Specified by:
ejbLoad in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - Signals that an EJB exception can occur.

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException
ejbStore required callback method for Contaimer Managed Persistence.

Specified by:
ejbStore in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - Signals that an EJB exception can occur.

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      javax.ejb.RemoveException
ejbRemove required callback method for Contaimer Managed Persistence.

Specified by:
ejbRemove in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - Signals that an EJB exception can occur.
javax.ejb.RemoveException - Signals that a Remove exception can occur.

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException
ejbActivate required callback method for lifecycle notification. No actions need to be taken for Dept.

Specified by:
ejbActivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - Signals that an EJB exception can occur.

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException
ejbPassivate required callback method for lifecycle notification. No actions need to be taken for Dept.

Specified by:
ejbPassivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException - Signals that an EJB exception can occur.