1 /*** $Id: LoadEmployeeRecord.java,v 1.1.1.1 2004/05/18 10:50:21 mochoa Exp $ */
2
3 package cmd_dao.sample.common.hibernate.employee;
4 //dao
5 import org.j2ee.dao.AbstractHibernateDAOAction;
6 //dto
7 import cmd_dao.sample.common.dto.EmployeeTO;
8
9 /***
10 * Last modified $Date: 2004/05/18 10:50:21 $
11 * @version $Revision: 1.1.1.1 $
12 * @author Hibernate Action Generator
13 * This class is concrete implementation for an action using Hibernate.
14 *
15 * Based on an example of book Code Notes for J2EE, Edited by GREGORY BRILL,
16 * e-ISBN 0-679-64727-9
17 * Automated generated code, DO NOT EDIT
18 */
19 public class LoadEmployeeRecord extends AbstractHibernateDAOAction {
20
21 private EmployeeTO employeeTO = null;
22
23 /***
24 * Default constructor, calls to the super class given the kind
25 * of action to be implement.
26 */
27 public LoadEmployeeRecord() {
28 super(AbstractHibernateDAOAction.LOAD);
29 }
30
31
32 /***
33 * Class constructor setting the DTO.
34 * First calls to the default contructor to set the operation
35 * then set the private instance with the given DTO.
36 * @param dto for this action
37 */
38 public LoadEmployeeRecord(EmployeeTO dto) {
39 this();
40 this.employeeTO = dto;
41 }
42
43
44 /***
45 * getter method for the private attribute
46 */
47 public EmployeeTO getEmployeeTO() {
48 return this.employeeTO;
49 }
50
51 /***
52 * getter method for the private attribute
53 */
54 public Object getTO() {
55 return this.employeeTO;
56 }
57
58 /***
59 * setter method for the private attribute
60 */
61 public void setEmployeeTO(EmployeeTO dto) {
62 this.employeeTO = dto;
63 }
64
65 /***
66 * setter method for the private attribute
67 */
68 public void setTO(Object dto) {
69 this.employeeTO = (EmployeeTO)dto;
70 }
71
72 public LoadEmployeeRecord(java.lang.Integer key) {
73 this();
74 employeeTO= new EmployeeTO();
75 employeeTO.setNo(key);
76 }
77
78
79 /***
80 * setter method for the private attribute
81 */
82 public void setNo(java.lang.Integer key) {
83 if (employeeTO==null)
84 employeeTO= new EmployeeTO();
85 employeeTO.setNo(key);
86 }
87
88 public void handleResult(Object dto) throws Exception {
89 this.employeeTO = (EmployeeTO)dto;
90 }
91
92
93 /***
94 * This method is called from DAOHibernateActionProcessorImpl
95 * They must return the parameters for the operation to be called.
96 * For insert/delete/update operations it only needs the transfer object
97 * For Load operation it needs the transfer object and primary key.
98 * @return an array of objects.
99 */
100 public Object[] getParameters() {
101 return new Object[] { this.employeeTO,this.employeeTO.getNo() };
102 }
103
104 }
105
106
This page was automatically generated by Maven