1 4 package test.ejb.cmr; 5 6 13 public abstract class EmployeeCMP 14 extends test.ejb.cmr.EmployeeBean 15 implements javax.ejb.EntityBean 16 { 17 18 public test.ejb.cmr.EmployeeData getData() 19 { 20 test.ejb.cmr.EmployeeData dataHolder = null; 21 try 22 { 23 dataHolder = new test.ejb.cmr.EmployeeData(); 24 25 dataHolder.setId( getId() ); 26 dataHolder.setName( getName() ); 27 28 } 29 catch (RuntimeException e) 30 { 31 throw new javax.ejb.EJBException (e); 32 } 33 34 return dataHolder; 35 } 36 37 42 public void ejbPostCreate(test.ejb.cmr.EmployeeValue ev) 43 { 44 } 45 46 public void ejbLoad() 47 { 48 } 49 50 public void ejbStore() 51 { 52 } 53 54 public void ejbActivate() 55 { 56 } 57 58 public void ejbPassivate() 59 { 60 61 EmployeeValue = null; 62 } 63 64 public void setEntityContext(javax.ejb.EntityContext ctx) 65 { 66 } 67 68 public void unsetEntityContext() 69 { 70 } 71 72 public void ejbRemove() throws javax.ejb.RemoveException 73 { 74 75 } 76 77 78 79 private test.ejb.cmr.EmployeeValue EmployeeValue = null; 80 81 public test.ejb.cmr.EmployeeValue getEmployeeValue() 82 { 83 EmployeeValue = new test.ejb.cmr.EmployeeValue(); 84 try 85 { 86 EmployeeValue.setId( getId() ); 87 EmployeeValue.setName( getName() ); 88 if ( getHomeAddress() != null ) 89 EmployeeValue.setHomeAddress( getHomeAddress().getEmployeeAddressValue() ); 90 if ( getWorkAddress() != null ) 91 EmployeeValue.setWorkAddress( getWorkAddress().getEmployeeAddressValue() ); 92 93 } 94 catch (Exception e) 95 { 96 throw new javax.ejb.EJBException (e); 97 } 98 99 return EmployeeValue; 100 } 101 102 public void setEmployeeValue( test.ejb.cmr.EmployeeValue valueHolder ) 103 { 104 105 try 106 { 107 setName( valueHolder.getName() ); 108 109 { 110 if (valueHolder.getHomeAddress() != null) 112 { 113 java.lang.Integer pk = valueHolder.getHomeAddress().getId(); 114 115 test.ejb.cmr.EmployeeAddressLocalHome home = test.ejb.cmr.EmployeeAddressUtil.getLocalHome(); 116 117 test.ejb.cmr.EmployeeAddressLocal relation = home.findByPrimaryKey(pk); 118 setHomeAddress(relation); 119 } else { 120 setHomeAddress(null); 121 } 122 } 123 { 124 if (valueHolder.getWorkAddress() != null) 126 { 127 java.lang.Integer pk = valueHolder.getWorkAddress().getId(); 128 129 test.ejb.cmr.EmployeeAddressLocalHome home = test.ejb.cmr.EmployeeAddressUtil.getLocalHome(); 130 131 test.ejb.cmr.EmployeeAddressLocal relation = home.findByPrimaryKey(pk); 132 setWorkAddress(relation); 133 } else { 134 setWorkAddress(null); 135 } 136 } 137 } 138 catch (Exception e) 139 { 140 throw new javax.ejb.EJBException (e); 141 } 142 } 143 144 145 146 public abstract java.lang.Integer getId() ; 147 148 public abstract void setId( java.lang.Integer id ) ; 149 150 public abstract java.lang.String getName() ; 151 152 public abstract void setName( java.lang.String name ) ; 153 154 } 155 | Popular Tags |