1 /*** $Id: EmployeeBeanCMP11.java,v 1.1.1.1 2004/05/18 10:50:21 mochoa Exp $ */
2 package cmd_dao.sample.common.ejb.employee;
3
4 import cmd_dao.sample.common.dto.EmployeeTO;
5
6 import javax.ejb.EntityBean;
7 import javax.ejb.EntityContext;
8 import java.sql.Timestamp;
9
10 /***
11 * Last modified $Date: 2004/05/18 10:50:21 $
12 * @version $Revision: 1.1.1.1 $
13 * @author %my_name% (%my_mail%) - %date% - %time%
14 */
15 public class EmployeeBeanCMP11 implements EntityBean {
16
17 protected EntityContext ctx;
18
19 public String job;
20 public Integer deptNo;
21 public Integer manager;
22 public String name;
23 public Timestamp hireDate;
24 public Double comm;
25 public Double salary;
26 public Integer no;
27
28 public EmployeePK ejbCreate(EmployeeTO emp) {
29 setDetails(emp);
30 return new EmployeePK(emp.getNo());
31 }
32 public void ejbPostCreate(EmployeeTO emp) {}
33
34 public EmployeeTO getDetails() {
35 EmployeeTO emp = new EmployeeTO();
36 emp.setJob(getJob());
37 emp.setDeptNo(getDeptNo());
38 emp.setManager(getManager());
39 emp.setName(getName());
40 emp.setHireDate(getHireDate());
41 emp.setComm(getComm());
42 emp.setSalary(getSalary());
43 emp.setNo(getNo());
44 return emp;
45 }
46
47 public void setDetails(EmployeeTO emp) {
48 setJob(emp.getJob());
49 setDeptNo(emp.getDeptNo());
50 setManager(emp.getManager());
51 setName(emp.getName());
52 setHireDate(emp.getHireDate());
53 setComm(emp.getComm());
54 setSalary(emp.getSalary());
55 setNo(emp.getNo());
56 }
57
58 public String getJob() { return job; }
59 public void setJob(String job) { this.job = job; }
60
61 public Integer getDeptNo() { return deptNo; }
62 public void setDeptNo(Integer deptNo) { this.deptNo = deptNo; }
63
64 public Integer getManager() { return manager; }
65 public void setManager(Integer manager) { this.manager = manager; }
66
67 public String getName() { return name; }
68 public void setName(String name) { this.name = name; }
69
70 public Timestamp getHireDate() { return hireDate; }
71 public void setHireDate(Timestamp hireDate) { this.hireDate = hireDate; }
72
73 public Double getComm() { return comm; }
74 public void setComm(Double comm) { this.comm = comm; }
75
76 public Double getSalary() { return salary; }
77 public void setSalary(Double salary) { this.salary = salary; }
78
79 public Integer getNo() { return no; }
80 public void setNo(Integer no) { this.no = no; }
81
82 /***
83 * Called by Container. Associates this Bean instance with
84 * a particular context. Once done, we can query the
85 * Context for environment info
86 */
87 public void setEntityContext(EntityContext ctx) { this.ctx = ctx; }
88
89 /***
90 * Called by Container. Disassociates this Bean instance
91 * with a particular context environment.
92 */
93 public void unsetEntityContext() { this.ctx = null; }
94
95 public void ejbActivate() {}
96 public void ejbLoad() {}
97 public void ejbPassivate() {}
98 public void ejbRemove() {}
99 public void ejbStore() {}
100
101 }
This page was automatically generated by Maven