org.apache.jdo.tck.pc.company
Class Employee

java.lang.Object
  extended byorg.apache.jdo.tck.pc.company.Person
      extended byorg.apache.jdo.tck.pc.company.Employee
All Implemented Interfaces:
java.lang.Comparable, DeepEquality, java.io.Serializable
Direct Known Subclasses:
FullTimeEmployee, PartTimeEmployee

public abstract class Employee
extends Person

This class represents an employee.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.apache.jdo.tck.pc.company.Person
Person.Oid
 
Field Summary
 
Fields inherited from class org.apache.jdo.tck.pc.company.Person
formatter
 
Constructor Summary
protected Employee()
          This is the JDO-required no-args constructor
  Employee(long personid, java.lang.String firstname, java.lang.String lastname, java.lang.String middlename, java.util.Date birthdate, Address address, java.util.Date hiredate)
          Initialize an Employee instance.
 
Method Summary
 void addAdvisee(Employee emp)
          Add an Employee as an advisee of this HR advisor.
 void addProject(Project project)
          Add a project for the employee.
 void addReviewedProjects(Project project)
          Add a reviewed project.
 void addToTeam(Employee emp)
          Add an Employee to this employee's team.
 boolean deepCompareFields(DeepEquality other, EqualityHelper helper)
          Returns true if all the fields of this instance are deep equal to the corresponding fields of the specified Employee.
 DentalInsurance getDentalInsurance()
          Get the dental insurance of the employee.
 Department getDepartment()
          Get the employee's department.
 Department getFundingDept()
          Get the employee's funding department.
 java.util.Date getHiredate()
          Get the date that the employee was hired.
 java.util.Set getHradvisees()
          Get the HR advisees of this HR advisor.
 Employee getHradvisor()
          Get the HR advisor for the employee.
 Employee getManager()
          Get the employee's manager.
 MedicalInsurance getMedicalInsurance()
          Get the medical insurance of the employee.
 Employee getMentor()
          Get the mentor for this employee.
 java.util.Set getProjects()
          Get the employee's projects.
 Employee getProtege()
          Get the protege of this employee.
 java.util.Set getReviewedProjects()
          Get the reviewed projects.
 java.util.Set getTeam()
          Get the employee's team.
 double getWeeklyhours()
          Get the weekly hours of the employee.
 void removeAdvisee(Employee emp)
          Remove an Employee as an advisee of this HR advisor.
 void removeFromTeam(Employee emp)
          Remove an Employee from this employee's team.
 void removeProject(Project project)
          Remove a project from an employee's set of projects.
 void removeReviewedProject(Project project)
          Remove a reviewed project.
 void setDentalInsurance(DentalInsurance dentalInsurance)
          Set the dental insurance object for the employee.
 void setDepartment(Department department)
          Set the employee's department.
 void setFundingDept(Department department)
          Set the employee's funding department.
 void setHiredate(java.util.Date hiredate)
          Set the date that the employee was hired.
 void setHradvisees(java.util.Set hradvisees)
          Set the HR advisees of this HR advisor.
 void setManager(Employee manager)
          Set the employee's manager.
 void setMedicalInsurance(MedicalInsurance medicalInsurance)
          Set the medical insurance object for the employee.
 void setMentor(Employee mentor)
          Set the mentor for this employee and also set the inverse protege relationship.
 void setProjects(java.util.Set projects)
          Set the projects for the employee.
 void setReviewedProjects(java.util.Set reviewedProjects)
          Set the reviewed projects for the employee.
 void setTeam(java.util.Set team)
          Set the employee's team.
 void setWeeklyhours(double weeklyhours)
          Set the number of hours per week that the employee works.
 
Methods inherited from class org.apache.jdo.tck.pc.company.Person
compareTo, compareTo, equals, getAddress, getBirthdate, getFirstname, getLastname, getMiddlename, getPersonid, getPhoneNumber, getPhoneNumbers, hashCode, putPhoneNumber, removePhoneNumber, setAddress, setBirthdate, setFirstname, setLastname, setLastname, setMiddlename, setPhoneNumbers, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Employee

protected Employee()
This is the JDO-required no-args constructor


Employee

public Employee(long personid,
                java.lang.String firstname,
                java.lang.String lastname,
                java.lang.String middlename,
                java.util.Date birthdate,
                Address address,
                java.util.Date hiredate)
Initialize an Employee instance.

Parameters:
personid - The identifier for the person.
firstname - The first name of the employee.
lastname - The last name of the employee.
middlename - The middle name of the employee.
birthdate - The birth date of the employee.
address - The address of the employee.
hiredate - The date that the employee was hired.
Method Detail

getHiredate

public java.util.Date getHiredate()
Get the date that the employee was hired.

Returns:
The date the employee was hired.

setHiredate

public void setHiredate(java.util.Date hiredate)
Set the date that the employee was hired.

Parameters:
hiredate - The date the employee was hired.

getWeeklyhours

public double getWeeklyhours()
Get the weekly hours of the employee.

Returns:
The number of hours per week that the employee works.

setWeeklyhours

public void setWeeklyhours(double weeklyhours)
Set the number of hours per week that the employee works.

Parameters:
weeklyhours - The number of hours per week that the employee works.

getReviewedProjects

public java.util.Set getReviewedProjects()
Get the reviewed projects.

Returns:
The reviewed projects as an unmodifiable set.

addReviewedProjects

public void addReviewedProjects(Project project)
Add a reviewed project.

Parameters:
project - A reviewed project.

removeReviewedProject

public void removeReviewedProject(Project project)
Remove a reviewed project.

Parameters:
project - A reviewed project.

setReviewedProjects

public void setReviewedProjects(java.util.Set reviewedProjects)
Set the reviewed projects for the employee.

Parameters:
reviewedProjects - The set of reviewed projects.

getProjects

public java.util.Set getProjects()
Get the employee's projects.

Returns:
The employee's projects are returned as an unmodifiable set.

addProject

public void addProject(Project project)
Add a project for the employee.

Parameters:
project - The project.

removeProject

public void removeProject(Project project)
Remove a project from an employee's set of projects.

Parameters:
project - The project.

setProjects

public void setProjects(java.util.Set projects)
Set the projects for the employee.

Parameters:
projects - The set of projects of the employee.

getDentalInsurance

public DentalInsurance getDentalInsurance()
Get the dental insurance of the employee.

Returns:
The employee's dental insurance.

setDentalInsurance

public void setDentalInsurance(DentalInsurance dentalInsurance)
Set the dental insurance object for the employee.

Parameters:
dentalInsurance - The dental insurance object to associate with the employee.

getMedicalInsurance

public MedicalInsurance getMedicalInsurance()
Get the medical insurance of the employee.

Returns:
The employee's medical insurance.

setMedicalInsurance

public void setMedicalInsurance(MedicalInsurance medicalInsurance)
Set the medical insurance object for the employee.

Parameters:
medicalInsurance - The medical insurance object to associate with the employee.

getDepartment

public Department getDepartment()
Get the employee's department.

Returns:
The department associated with the employee.

setDepartment

public void setDepartment(Department department)
Set the employee's department.

Parameters:
department - The department.

getFundingDept

public Department getFundingDept()
Get the employee's funding department.

Returns:
The funding department associated with the employee.

setFundingDept

public void setFundingDept(Department department)
Set the employee's funding department.

Parameters:
department - The funding department.

getManager

public Employee getManager()
Get the employee's manager.

Returns:
The employee's manager.

setManager

public void setManager(Employee manager)
Set the employee's manager.

Parameters:
manager - The employee's manager.

getTeam

public java.util.Set getTeam()
Get the employee's team.

Returns:
The set of Employees on this employee's team, returned as an unmodifiable set.

addToTeam

public void addToTeam(Employee emp)
Add an Employee to this employee's team. This method sets both sides of the relationship, modifying this employees team to include parameter emp and modifying emp to set its manager attribute to this object.

Parameters:
emp - The Employee to add to the team.

removeFromTeam

public void removeFromTeam(Employee emp)
Remove an Employee from this employee's team. This method will also set the emp manager to null.

Parameters:
emp - The Employee to remove from the team.

setTeam

public void setTeam(java.util.Set team)
Set the employee's team.

Parameters:
team - The set of Employees.

setMentor

public void setMentor(Employee mentor)
Set the mentor for this employee and also set the inverse protege relationship.

Parameters:
mentor - The mentor for this employee.

getMentor

public Employee getMentor()
Get the mentor for this employee.

Returns:
The mentor.

getProtege

public Employee getProtege()
Get the protege of this employee.

Returns:
The protege of this employee.

getHradvisor

public Employee getHradvisor()
Get the HR advisor for the employee.

Returns:
The HR advisor.

getHradvisees

public java.util.Set getHradvisees()
Get the HR advisees of this HR advisor.

Returns:
An unmodifiable Set containing the Employees that are HR advisees of this employee.

addAdvisee

public void addAdvisee(Employee emp)
Add an Employee as an advisee of this HR advisor. This method also sets the emp hradvisor to reference this object. In other words, both sides of the relationship are set.

Parameters:
emp - The employee to add as an advisee.

removeAdvisee

public void removeAdvisee(Employee emp)
Remove an Employee as an advisee of this HR advisor. This method also sets the emp hradvisor to null. In other words, both sides of the relationship are set.

Parameters:
emp - The employee to add as an HR advisee.

setHradvisees

public void setHradvisees(java.util.Set hradvisees)
Set the HR advisees of this HR advisor.

Parameters:
hradvisees - The Employees that are HR advisees of this employee.

deepCompareFields

public boolean deepCompareFields(DeepEquality other,
                                 EqualityHelper helper)
Returns true if all the fields of this instance are deep equal to the corresponding fields of the specified Employee.

Specified by:
deepCompareFields in interface DeepEquality
Overrides:
deepCompareFields in class Person
Parameters:
other - the object with which to compare.
helper - EqualityHelper to keep track of instances that have already been processed.
Returns:
true if all the fields are deep equal; false otherwise.
Throws:
java.lang.ClassCastException - if the specified instances' type prevents it from being compared to this instance.


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.