1 /*** $Id: InsertEmployeeRecord.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 InsertEmployeeRecord 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 InsertEmployeeRecord() { 28 super(AbstractHibernateDAOAction.SAVE); 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 InsertEmployeeRecord(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 73 /*** 74 * This method is called from DAOHibernateActionProcessorImpl 75 * They must return the parameters for the operation to be called. 76 * For insert/delete/update operations it only needs the transfer object 77 * For Load operation it needs the transfer object and primary key. 78 * @return an array of objects. 79 */ 80 public Object[] getParameters() { 81 return new Object[] { this.employeeTO }; 82 } 83 84 } 85 86

This page was automatically generated by Maven