1 22 package org.jboss.test.cmp2.cmr.ejb; 23 24 25 import java.util.Collection ; 26 27 import javax.ejb.CreateException ; 28 import javax.ejb.EJBException ; 29 import javax.ejb.EntityBean ; 30 import javax.ejb.EntityContext ; 31 32 import org.jboss.test.cmp2.cmr.interfaces.CMRBugEJBLocal; 33 34 57 public abstract class CMRBugBean 58 implements EntityBean 59 { 60 private EntityContext context; 61 62 69 public abstract String getId(); 70 71 77 public abstract void setId(String id); 78 79 86 public abstract String getDescription(); 87 88 94 public abstract void setDescription(String description); 95 96 106 public abstract CMRBugEJBLocal getParent(); 107 108 114 public abstract void setParent(CMRBugEJBLocal parent); 115 116 126 public abstract Collection getChildren(); 127 128 134 public abstract void setChildren(Collection children); 135 136 143 public boolean addChild(CMRBugEJBLocal child) 144 { 145 try 146 { 147 Collection children = getChildren(); 148 return children.add(child); 149 } 150 catch(Exception e) 151 { 152 throw new EJBException (e); 153 } 154 } 155 156 163 public boolean removeChild(CMRBugEJBLocal child) 164 { 165 try 166 { 167 Collection children = getChildren(); 168 return children.remove(child); 169 } 170 catch(Exception e) 171 { 172 throw new EJBException (e); 173 } 174 } 175 176 182 194 public abstract CMRBugEJBLocal getPrevNode(); 195 198 public abstract void setPrevNode(CMRBugEJBLocal a_ViewComponent); 199 200 212 public abstract CMRBugEJBLocal getNextNode(); 213 216 public abstract void setNextNode(CMRBugEJBLocal a_ViewComponent); 217 218 222 232 public String ejbCreate(String id, String description, CMRBugEJBLocal parent) 233 throws CreateException 234 { 235 setId(id); 236 setDescription(description); 237 238 return null; 241 } 242 243 251 public void ejbPostCreate(String id, String description, CMRBugEJBLocal parent) 252 throws CreateException 253 { 254 setParent(parent); 257 } 258 259 public void setEntityContext(EntityContext context) 260 { 261 this.context = context; 262 } 263 264 public void unsetEntityContext() 265 { 266 context = null; 267 } 268 269 public void ejbRemove() 270 { 271 } 272 273 public void ejbLoad() 274 { 275 } 276 277 public void ejbStore() 278 { 279 } 280 281 public void ejbActivate() 282 { 283 } 284 285 public void ejbPassivate() 286 { 287 } 288 } 289 | Popular Tags |