com.ibm.websphere.samples.ejbquery.employeefinderejb
Interface Emp

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote

public interface Emp
extends javax.ejb.EJBObject

The Remote Interface Business Methods for the Emp CMP Sample.


Method Summary
 int add1()
          add1 method returns empid + 1.
 double calcBonus(double profitFactor)
          calcBonus method calculates an employee's annual bonus given a positive profitFactor.
 double getBonus()
          This Remote method gets the bonus CMP attribute for an Emp.
 java.lang.Integer getEmpid()
          This Remote method gets the empid CMP attribute for an Emp.
 java.sql.Date getHireDate()
          This Remote method gets the hireDate CMP attribute for an Emp.
 java.sql.Time getHireTime()
          This Remote method gets the hireTime CMP attribute for an Emp.
 java.sql.Timestamp getHireTimestamp()
          This Remote method gets the hireTimestamp CMP attribute for an Emp.
 boolean getIsManager()
          This Remote method gets the isManager CMP attribute for an Emp.
 java.lang.String getName()
          This Remote method gets the name CMP attribute for an Emp.
 double getSalary()
          This Remote method gets the salary CMP attribute for an Emp.
 void setBonus(double bonus)
          This Remote method sets the bonus CMP attribute for an Emp.
 void setHireDate(java.sql.Date hireDate)
          This Remote method sets the hireDate CMP attribute for an Emp.
 void setHireTime(java.sql.Time hireTime)
          This Remote method sets the hireTime CMP attribute for an Emp.
 void setHireTimestamp(java.sql.Timestamp hireTimestamp)
          This Remote method sets the hireTimestamp CMP attribute for an Emp.
 void setIsManager(boolean isManager)
          This Remote method sets the isManager CMP attribute for an Emp.
 void setName(java.lang.String name)
          This Remote method sets the name CMP attribute for an Emp.
 void setSalary(double salary)
          This Remote method sets the salary CMP attribute for an Emp.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

getEmpid

java.lang.Integer getEmpid()
                           throws java.rmi.RemoteException
This Remote method gets the empid CMP attribute for an Emp.

Returns:
java.lang.Integer
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getName

java.lang.String getName()
                         throws java.rmi.RemoteException
This Remote method gets the name CMP attribute for an Emp.

Returns:
java.lang.String
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setName

void setName(java.lang.String name)
             throws java.rmi.RemoteException
This Remote method sets the name CMP attribute for an Emp.

Parameters:
name - java.lang.String
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getSalary

double getSalary()
                 throws java.rmi.RemoteException
This Remote method gets the salary CMP attribute for an Emp.

Returns:
double
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setSalary

void setSalary(double salary)
               throws java.rmi.RemoteException
This Remote method sets the salary CMP attribute for an Emp.

Parameters:
salary - double
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getBonus

double getBonus()
                throws java.rmi.RemoteException
This Remote method gets the bonus CMP attribute for an Emp.

Returns:
double
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setBonus

void setBonus(double bonus)
              throws java.rmi.RemoteException
This Remote method sets the bonus CMP attribute for an Emp.

Parameters:
bonus - double
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getHireDate

java.sql.Date getHireDate()
                          throws java.rmi.RemoteException
This Remote method gets the hireDate CMP attribute for an Emp.

Returns:
java.sql.Date
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setHireDate

void setHireDate(java.sql.Date hireDate)
                 throws java.rmi.RemoteException
This Remote method sets the hireDate CMP attribute for an Emp.

Parameters:
hireDate - java.sql.Date
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getHireTime

java.sql.Time getHireTime()
                          throws java.rmi.RemoteException
This Remote method gets the hireTime CMP attribute for an Emp.

Returns:
java.sql.Time
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setHireTime

void setHireTime(java.sql.Time hireTime)
                 throws java.rmi.RemoteException
This Remote method sets the hireTime CMP attribute for an Emp.

Parameters:
hireTime - java.sql.Time
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getHireTimestamp

java.sql.Timestamp getHireTimestamp()
                                    throws java.rmi.RemoteException
This Remote method gets the hireTimestamp CMP attribute for an Emp.

Returns:
java.sql.Timestamp
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setHireTimestamp

void setHireTimestamp(java.sql.Timestamp hireTimestamp)
                      throws java.rmi.RemoteException
This Remote method sets the hireTimestamp CMP attribute for an Emp.

Parameters:
hireTimestamp - java.sql.Timestamp
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

getIsManager

boolean getIsManager()
                     throws java.rmi.RemoteException
This Remote method gets the isManager CMP attribute for an Emp.

Returns:
boolean
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

setIsManager

void setIsManager(boolean isManager)
                  throws java.rmi.RemoteException
This Remote method sets the isManager CMP attribute for an Emp.

Parameters:
isManager - boolean
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

add1

int add1()
         throws java.rmi.RemoteException
add1 method returns empid + 1.

eg. select e.add1() from EmpBean 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
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.

calcBonus

double calcBonus(double profitFactor)
                 throws java.rmi.RemoteException
calcBonus method calculates an employee's annual bonus given a positive profitFactor.
For non managers this is calculated by multiplying the yearsWorked, the profitFactor, and the profitUnit.
For managers, the previous result is further multiplied by the mgrFactor if the profitFactor is greater than 0.1.
In the method, profitUnit is fixed at 1000 and mgrFactor at 2.

eg. select e.calcBonus(0.2) from EmpBean 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.

Parameters:
profitFactor - the fractional increase of the value of the company during the current the year
Returns:
double
Throws:
java.rmi.RemoteException - Signals that a Remote exception of some sort has occurred.