1 4 package test.ejb; 5 6 13 public abstract class AccountCMP 14 extends test.ejb.AccountBean 15 implements javax.ejb.EntityBean 16 { 17 18 public test.interfaces.AccountData getData() 19 { 20 test.interfaces.AccountData dataHolder = null; 21 try 22 { 23 dataHolder = new test.interfaces.AccountData(); 24 25 dataHolder.setId( getId() ); 26 dataHolder.setOwner( getOwner() ); 27 dataHolder.setBalance( getBalance() ); 28 dataHolder.setLastModificationDate( getLastModificationDate() ); 29 dataHolder.setAccountId( getAccountId() ); 30 dataHolder.setCreationDate( getCreationDate() ); 31 32 } 33 catch (RuntimeException e) 34 { 35 throw new javax.ejb.EJBException (e); 36 } 37 38 return dataHolder; 39 } 40 41 public void setData( test.interfaces.AccountData dataHolder ) 42 { 43 try 44 { 45 setOwner( dataHolder.getOwner() ); 46 setBalance( dataHolder.getBalance() ); 47 setLastModificationDate( dataHolder.getLastModificationDate() ); 48 setCreationDate( dataHolder.getCreationDate() ); 49 50 } 51 catch (Exception e) 52 { 53 throw new javax.ejb.EJBException (e); 54 } 55 } 56 57 public void ejbLoad() throws javax.ejb.EJBException 58 { 59 super.ejbLoad(); 60 } 61 62 public void ejbStore() throws javax.ejb.EJBException 63 { 64 super.ejbStore(); 65 } 66 67 public void ejbActivate() throws javax.ejb.EJBException 68 { 69 super.ejbActivate(); 70 } 71 72 public void ejbPassivate() throws javax.ejb.EJBException 73 { 74 super.ejbPassivate(); 75 76 AccountValue = null; 77 } 78 79 public void setEntityContext(javax.ejb.EntityContext ctx) throws javax.ejb.EJBException 80 { 81 super.setEntityContext(ctx); 82 } 83 84 public void unsetEntityContext() throws javax.ejb.EJBException 85 { 86 super.unsetEntityContext(); 87 } 88 89 public void ejbRemove() throws javax.ejb.EJBException , javax.ejb.RemoveException 90 { 91 super.ejbRemove(); 92 93 } 94 95 96 97 private test.interfaces.AccountValue AccountValue = null; 98 99 public test.interfaces.AccountValue getAccountValue() 100 { 101 AccountValue = new test.interfaces.AccountValue(); 102 try 103 { 104 AccountValue.setId( getId() ); 105 AccountValue.setBalance( getBalance() ); 106 if ( getOwner() != null ) 107 AccountValue.setOwnerNormalValue( getOwner().getCustomerNormalValue() ); 108 109 } 110 catch (Exception e) 111 { 112 throw new javax.ejb.EJBException (e); 113 } 114 115 return AccountValue; 116 } 117 118 public void setAccountValue( test.interfaces.AccountValue valueHolder ) 119 { 120 121 try 122 { 123 setBalance( valueHolder.getBalance() ); 124 125 { 126 if (valueHolder.getOwnerNormalValue() != null) 128 { 129 test.interfaces.CustomerPK pk = new test.interfaces.CustomerPK(valueHolder.getOwnerNormalValue().getId()); 130 131 test.interfaces.CustomerHome home = test.interfaces.CustomerUtil.getHome(); 132 133 test.interfaces.Customer relation = home.findByPrimaryKey(pk); 134 setOwner(relation); 135 } else { 136 setOwner(null); 137 } 138 } 139 } 140 catch (Exception e) 141 { 142 throw new javax.ejb.EJBException (e); 143 } 144 } 145 146 147 148 public abstract java.lang.Integer getId() ; 149 150 public abstract void setId( java.lang.Integer id ) ; 151 152 public abstract test.interfaces.Customer getOwner() ; 153 154 public abstract void setOwner( test.interfaces.Customer owner ) ; 155 156 public abstract float getBalance() ; 157 158 public abstract void setBalance( float balance ) ; 159 160 public abstract java.util.Date getLastModificationDate() ; 161 162 public abstract void setLastModificationDate( java.util.Date lastModificationDate ) ; 163 164 public abstract java.lang.String getAccountId() ; 165 166 public abstract void setAccountId( java.lang.String accountId ) ; 167 168 public abstract java.util.Date getCreationDate() ; 169 170 public abstract void setCreationDate( java.util.Date creationDate ) ; 171 172 } 173 | Popular Tags |