1 22 package org.jboss.test.cmp2.batchcascadedelete.ejb; 23 24 25 import java.rmi.RemoteException ; 26 import javax.ejb.CreateException ; 27 import javax.ejb.EJBException ; 28 import javax.ejb.EntityBean ; 29 import javax.ejb.EntityContext ; 30 import javax.ejb.FinderException ; 31 import javax.ejb.RemoveException ; 32 import javax.naming.NamingException ; 33 34 38 public abstract class GrandchildBean 39 implements EntityBean 40 { 41 42 public Long ejbCreate(Long childId, String name) throws CreateException 43 { 44 setId(new Long (System.currentTimeMillis())); 45 setName(name); 46 47 return null; 48 } 49 50 public void ejbPostCreate(Long childId, String name) throws CreateException 51 { 52 ChildLocalHome h; 53 try 54 { 55 h = ChildUtil.getLocalHome(); 56 setTheChild(h.findByPrimaryKey(childId)); 57 } 58 catch(NamingException e) 59 { 60 throw new CreateException (e.toString()); 61 } 62 catch(FinderException e) 63 { 64 throw new CreateException (e.toString()); 65 } 66 } 67 68 public abstract Long getId(); 69 70 public abstract void setId(Long id); 71 72 public abstract String getName(); 73 74 public abstract void setName(String name); 75 76 public GrandchildBean() 77 { 78 super(); 79 } 80 81 public abstract ChildLocal getTheChild(); 82 83 public abstract void setTheChild(ChildLocal theChild); 84 85 public void setEntityContext(EntityContext arg0) throws EJBException , RemoteException 86 { 87 } 88 89 public void unsetEntityContext() throws EJBException , RemoteException 90 { 91 } 92 93 public void ejbRemove() throws RemoveException , EJBException , RemoteException 94 { 95 } 96 97 public void ejbActivate() throws EJBException , RemoteException 98 { 99 } 100 101 public void ejbPassivate() throws EJBException , RemoteException 102 { 103 } 104 105 public void ejbLoad() throws EJBException , RemoteException 106 { 107 } 108 109 public void ejbStore() throws EJBException , RemoteException 110 { 111 } 112 } 113 | Popular Tags |