1 22 package org.jboss.test.banknew.ejb; 23 24 import java.util.Date ; 25 26 import org.jboss.test.banknew.interfaces.TransactionData; 27 import org.jboss.test.banknew.interfaces.TransactionPK; 28 import org.jboss.test.util.ejb.EntitySupport; 29 30 69 public abstract class TransactionBean 70 extends EntitySupport 71 { 72 74 76 78 private static int sId = 0; 79 80 82 84 90 abstract public String getId(); 91 92 abstract public void setId( String pId ); 93 94 99 abstract public String getAcountId(); 100 101 abstract public void setAcountId( String pAcountId ); 102 103 108 abstract public int getType(); 109 110 abstract public void setType( int pType ); 111 112 117 abstract public float getAmount(); 118 119 abstract public void setAmount( float pAmount ); 120 121 126 abstract public Date getDate(); 127 128 abstract public void setDate( Date pDate ); 129 130 135 abstract public String getDescription(); 136 137 abstract public void setDescription( String pDescription ); 138 139 142 abstract public TransactionData getData(); 143 144 abstract public void setData( TransactionData pDate ); 145 146 148 151 public TransactionPK ejbCreate( String pAccountId, int pType, float pAmount, String pDescription ) { 152 setId( "Tx: " + ( sId++ ) ); 153 setAcountId( pAccountId ); 154 setType( pType ); 155 setAmount( pAmount ); 156 setDescription( pDescription ); 157 setDate( new Date () ); 158 159 return null; 160 } 161 162 public void ejbPostCreate( String pAccountId, int pType, float pAmount, String pDescription ) 163 { 164 } 165 166 169 public TransactionPK ejbCreate( TransactionData pData ) { 170 setId( "Tx: " + ( sId++ ) ); 171 pData.setDate( new Date () ); 172 setData( pData ); 173 174 return null; 175 } 176 177 public void ejbPostCreate( TransactionData pData ) 178 { 179 } 180 } 181 182 234 | Popular Tags |