1 37 38 package com.sun.j2ee.blueprints.opc.purchaseorder.ejb; 39 40 import javax.ejb.*; 41 42 import com.sun.j2ee.blueprints.opc.purchaseorder.*; 43 44 48 49 public abstract class AddressBean implements EntityBean { 50 51 private EntityContext entityContext = null; 52 53 public Object ejbCreate(Address address) throws CreateException { 54 55 setStreetName1(address.getStreetName1()); 56 setStreetName2(address.getStreetName2()); 57 setCity(address.getCity()); 58 setState(address.getState()); 59 setPostalCode(address.getPostalCode()); 60 setCountry(address.getCountry()); 61 62 return null; 63 } 64 65 public void ejbPostCreate(Address address) throws CreateException {} 66 67 public abstract void setStreetName1(String streetName1); 69 70 public abstract void setStreetName2(String streetName2); 71 72 public abstract void setCity(String city); 73 74 public abstract void setState(String state); 75 76 public abstract void setPostalCode(String postalCode); 77 78 public abstract void setCountry(String country); 79 80 public abstract String getStreetName1(); 81 82 public abstract String getStreetName2(); 83 84 public abstract String getCity(); 85 86 public abstract String getState(); 87 88 public abstract String getPostalCode(); 89 90 public abstract String getCountry(); 91 92 public Address getDetails() { 93 Address address = new Address(); 94 address.setStreetName1(getStreetName1()); 95 address.setStreetName2(getStreetName2()); 96 address.setCity(getCity()); 97 address.setState(getState()); 98 address.setPostalCode(getPostalCode()); 99 address.setCountry(getCountry()); 100 return address; 101 102 } 103 104 public void ejbRemove() throws RemoveException { 105 } 106 107 public void ejbLoad() { 108 } 109 110 public void ejbStore() { 111 } 112 113 public void ejbActivate() { 114 } 115 116 public void ejbPassivate() { 117 } 118 119 public void unsetEntityContext() { 120 this.entityContext = null; 121 } 122 123 public void setEntityContext(EntityContext entityContext) { 124 this.entityContext = entityContext; 125 } 126 127 } 128 | Popular Tags |