1 22 package org.jboss.test.cmp2.fkmapping.ejb; 23 24 import javax.ejb.EntityContext ; 25 import javax.ejb.EntityBean ; 26 import javax.ejb.EJBException ; 27 import javax.ejb.RemoveException ; 28 import javax.ejb.CreateException ; 29 import java.rmi.RemoteException ; 30 31 48 public abstract class StudentEntityBean 49 implements EntityBean 50 { 51 private EntityContext ctx; 53 54 61 public abstract String getDepartmentCode(); 62 public abstract void setDepartmentCode(String deptCode); 63 64 70 public abstract String getDepartmentCode2(); 71 public abstract void setDepartmentCode2(String deptCode); 72 73 79 public abstract String getLastName(); 80 public abstract void setLastName(String lastName); 81 82 87 public abstract String getDescription(); 88 public abstract void setDescription(String description); 89 90 103 public abstract DepartmentLocal getDepartment(); 104 107 public abstract void setDepartment(DepartmentLocal department); 108 109 124 public abstract GroupLocal getGroup(); 125 128 public abstract void setGroup(GroupLocal group); 129 130 134 public StudentPK ejbCreate(String deptCode, String lastName, String descr) 135 throws CreateException 136 { 137 setDepartmentCode(deptCode); 138 setDepartmentCode2("X"+deptCode); 139 setLastName(lastName); 140 setDescription(descr); 141 return null; 142 } 143 144 public void ejbPostCreate(String deptCode, String lastName, String descr) {} 145 146 public void ejbActivate() throws EJBException , RemoteException {} 147 public void ejbLoad() throws EJBException , RemoteException {} 148 public void ejbPassivate() throws EJBException , RemoteException {} 149 public void ejbRemove() throws RemoveException , EJBException , RemoteException {} 150 public void ejbStore() throws EJBException , RemoteException {} 151 public void setEntityContext(EntityContext ctx) throws EJBException , RemoteException 152 { 153 this.ctx = ctx; 154 } 155 public void unsetEntityContext() throws EJBException , RemoteException 156 { 157 this.ctx = null; 158 } 159 } 160 | Popular Tags |