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