1 22 package org.jboss.test.cmp2.commerce; 23 24 import java.util.Collection ; 25 import javax.ejb.CreateException ; 26 import javax.ejb.EntityBean ; 27 import javax.ejb.EntityContext ; 28 import javax.ejb.FinderException ; 29 30 import org.jboss.varia.autonumber.AutoNumberFactory; 31 32 public abstract class AddressBean implements EntityBean { 33 transient private EntityContext ctx; 34 35 public Long ejbCreate() throws CreateException { 36 setId(new Long (AutoNumberFactory.getNextInteger("Address").longValue())); 37 return null; 38 } 39 40 public void ejbPostCreate() { 41 } 42 43 public Long ejbCreate(Long id) throws CreateException { 44 setId(id); 45 return null; 46 } 47 48 public void ejbPostCreate(Long id) { 49 } 50 51 public abstract Collection ejbSelectAddresses(String street) throws FinderException ; 52 public abstract Collection ejbSelectAddresses(int zip) throws FinderException ; 53 54 public Collection ejbHomeSelectAddresses(String street) throws FinderException 55 { 56 return ejbSelectAddresses(street); 57 } 58 59 public abstract Long getId(); 60 public abstract void setId(Long id); 61 62 public abstract String getStreet(); 63 public abstract void setStreet(String street); 64 65 public abstract String getCity(); 66 public abstract void setCity(String city); 67 68 public abstract String getState(); 69 public abstract void setState(String state); 70 71 public abstract int getZip(); 72 public abstract void setZip(int zip); 73 74 public abstract int getZipPlus4(); 75 public abstract void setZipPlus4(int zipPlus4); 76 77 public void setEntityContext(EntityContext ctx) { this.ctx = ctx; } 78 public void unsetEntityContext() { this.ctx = null; } 79 public void ejbActivate() { } 80 public void ejbPassivate() { } 81 public void ejbLoad() { } 82 public void ejbStore() { } 83 public void ejbRemove() { } 84 } 85 | Popular Tags |