1 22 package org.jboss.test.cmp2.commerce; 23 24 import java.util.Collection ; 25 import java.util.Set ; 26 import javax.ejb.CreateException ; 27 import javax.ejb.EntityBean ; 28 import javax.ejb.EntityContext ; 29 import javax.ejb.FinderException ; 30 31 import org.jboss.varia.autonumber.AutoNumberFactory; 32 33 public abstract class OrderBean implements EntityBean { 34 transient private EntityContext ctx; 35 36 public Long ejbCreate() throws CreateException { 37 setOrdernumber(new Long (AutoNumberFactory.getNextInteger("Order").longValue())); 38 return null; 39 } 40 41 public void ejbPostCreate() { 42 } 43 44 public Long ejbCreate(Long id) throws CreateException { 45 setOrdernumber(id); 46 return null; 47 } 48 49 public void ejbPostCreate(Long id) { 50 } 51 52 public abstract Long getOrdernumber(); 53 public abstract void setOrdernumber(Long ordernumber); 54 55 public abstract Card getCreditCard(); 56 public abstract void setCreditCard(Card card); 57 58 public abstract String getOrderStatus(); 59 public abstract void setOrderStatus(String orderStatus); 60 61 public abstract Customer getCustomer(); 62 public abstract void setCustomer(Customer c); 63 64 public abstract Collection getLineItems(); 65 public abstract void setLineItems(Collection lineItems); 66 67 public abstract Address getShippingAddress(); 68 public abstract void setShippingAddress(Address shippingAddress); 69 70 public abstract Address getBillingAddress(); 71 public abstract void setBillingAddress(Address billingAddress); 72 73 public abstract Set ejbSelectOrdersShippedToCA() throws FinderException ; 74 public abstract Set ejbSelectOrdersShippedToCA2() throws FinderException ; 75 76 public abstract Collection ejbSelectOrderShipToStates() 77 throws FinderException ; 78 public abstract Collection ejbSelectOrderShipToStates2() 79 throws FinderException ; 80 81 public abstract Set ejbSelectAddressesInCA() throws FinderException ; 82 public abstract Set ejbSelectAddressesInCA2() throws FinderException ; 83 84 public Set getOrdersShippedToCA() throws FinderException { 85 return ejbSelectOrdersShippedToCA(); 86 } 87 88 public Set getOrdersShippedToCA2() throws FinderException { 89 return ejbSelectOrdersShippedToCA2(); 90 } 91 92 public Collection getStatesShipedTo() throws FinderException { 93 return ejbSelectOrderShipToStates(); 94 } 95 96 public Collection getStatesShipedTo2() throws FinderException { 97 return ejbSelectOrderShipToStates2(); 98 } 99 100 public Set getAddressesInCA() throws FinderException { 101 return ejbSelectAddressesInCA(); 102 } 103 104 public Set getAddressesInCA2() throws FinderException { 105 return ejbSelectAddressesInCA2(); 106 } 107 108 public Set ejbHomeGetStuff(String jbossQl, Object [] arguments) 109 throws FinderException { 110 return ejbSelectGeneric(jbossQl, arguments); 111 } 112 113 public Set ejbHomeSelectLazy(String jbossQl, Object [] arguments) 114 throws FinderException { 115 return ejbSelectLazy(jbossQl, arguments); 116 } 117 118 public abstract Set ejbSelectGeneric(String jbossQl, Object [] arguments) 119 throws FinderException ; 120 121 public abstract Set ejbSelectLazy(String jbossQl, Object [] arguments) 122 throws FinderException ; 123 124 public void setEntityContext(EntityContext ctx) { this.ctx = ctx; } 125 public void unsetEntityContext() { this.ctx = null; } 126 public void ejbActivate() { } 127 public void ejbPassivate() { } 128 public void ejbLoad() { } 129 public void ejbStore() { } 130 public void ejbRemove() { } 131 } 132 | Popular Tags |