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 29 import org.jboss.varia.autonumber.AutoNumberFactory; 30 31 public abstract class ProductBean implements EntityBean { 32 transient private EntityContext ctx; 33 34 public Long ejbCreate() throws CreateException { 35 setId(new Long (AutoNumberFactory.getNextInteger("Product").longValue())); 36 return null; 37 } 38 39 public void ejbPostCreate() { } 40 41 public abstract Long getId(); 42 public abstract void setId(Long id); 43 44 public abstract String getName(); 45 public abstract void setName(String name); 46 47 public abstract String getType(); 48 public abstract void setType(String type); 49 50 public abstract String getUnit(); 51 public abstract void setUnit(String unit); 52 53 public abstract double getCostPerUnit(); 54 public abstract void setCostPerUnit(double cost); 55 56 public abstract double getWeight(); 57 public abstract void setWeight(double weight); 58 59 public abstract double getLength(); 60 public abstract void setLength(double length); 61 62 public abstract double getGirth(); 63 public abstract void setGirth(double girth); 64 65 public abstract Collection getProductCategories(); 66 public abstract void setProductCategories(Collection productCategories); 67 68 public void setEntityContext(EntityContext ctx) { this.ctx = ctx; } 69 public void unsetEntityContext() { 70 this.ctx = null; 71 } 72 public void ejbActivate() { } 73 public void ejbPassivate() { } 74 public void ejbLoad() { } 75 public void ejbStore() { } 76 public void ejbRemove() { } 77 } 78 | Popular Tags |