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 import java.util.Collection ; 31 32 51 public abstract class GroupEntityBean 52 implements EntityBean 53 { 54 private EntityContext ctx; 56 57 64 public abstract String getDepartmentCode(); 65 public abstract void setDepartmentCode(String deptCode); 66 67 73 public abstract String getDepartmentCode2(); 74 public abstract void setDepartmentCode2(String deptCode); 75 76 82 public abstract long getGroupNumber(); 83 public abstract void setGroupNumber(long groupNum); 84 85 90 public abstract String getDescription(); 91 public abstract void setDescription(String description); 92 93 106 public abstract DepartmentLocal getDepartment(); 107 110 public abstract void setDepartment(DepartmentLocal department); 111 112 118 public abstract Collection getStudents(); 119 122 public abstract void setStudents(Collection students); 123 124 130 public abstract Collection getExamenations(); 131 134 public abstract void setExamenations(Collection students); 135 136 140 public GroupPK ejbCreate(String deptCode, long groupNum, String descr) 141 throws CreateException 142 { 143 setDepartmentCode(deptCode); 144 setDepartmentCode2("X"+deptCode); 145 setGroupNumber(groupNum); 146 setDescription(descr); 147 return null; 148 } 149 150 public void ejbPostCreate(String deptCode, long groupNum, String descr) {} 151 152 public void ejbActivate() throws EJBException , RemoteException {} 153 public void ejbLoad() throws EJBException , RemoteException {} 154 public void ejbPassivate() throws EJBException , RemoteException {} 155 public void ejbRemove() throws RemoveException , EJBException , RemoteException {} 156 public void ejbStore() throws EJBException , RemoteException {} 157 public void setEntityContext(EntityContext ctx) throws EJBException , RemoteException 158 { 159 this.ctx = ctx; 160 } 161 public void unsetEntityContext() throws EJBException , RemoteException 162 { 163 this.ctx = null; 164 } 165 } 166 | Popular Tags |