KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > batchcascadedelete > ejb > GrandchildBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.cmp2.batchcascadedelete.ejb;
23
24
25 import java.rmi.RemoteException JavaDoc;
26 import javax.ejb.CreateException JavaDoc;
27 import javax.ejb.EJBException JavaDoc;
28 import javax.ejb.EntityBean JavaDoc;
29 import javax.ejb.EntityContext JavaDoc;
30 import javax.ejb.FinderException JavaDoc;
31 import javax.ejb.RemoveException JavaDoc;
32 import javax.naming.NamingException JavaDoc;
33
34 /**
35  * @author <a HREF="mailto:alex@jboss.org">Alexey Loubyansky</a>
36  * @version <tt>$Revision: 37406 $</tt>
37  */

38 public abstract class GrandchildBean
39    implements EntityBean JavaDoc
40 {
41
42    public Long JavaDoc ejbCreate(Long JavaDoc childId, String JavaDoc name) throws CreateException JavaDoc
43    {
44       setId(new Long JavaDoc(System.currentTimeMillis()));
45       setName(name);
46
47       return null;
48    }
49
50    public void ejbPostCreate(Long JavaDoc childId, String JavaDoc name) throws CreateException JavaDoc
51    {
52       ChildLocalHome h;
53       try
54       {
55          h = ChildUtil.getLocalHome();
56          setTheChild(h.findByPrimaryKey(childId));
57       }
58       catch(NamingException JavaDoc e)
59       {
60          throw new CreateException JavaDoc(e.toString());
61       }
62       catch(FinderException JavaDoc e)
63       {
64          throw new CreateException JavaDoc(e.toString());
65       }
66    }
67
68    public abstract Long JavaDoc getId();
69
70    public abstract void setId(Long JavaDoc id);
71
72    public abstract String JavaDoc getName();
73
74    public abstract void setName(String JavaDoc 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 JavaDoc arg0) throws EJBException JavaDoc, RemoteException JavaDoc
86    {
87    }
88
89    public void unsetEntityContext() throws EJBException JavaDoc, RemoteException JavaDoc
90    {
91    }
92
93    public void ejbRemove() throws RemoveException JavaDoc, EJBException JavaDoc, RemoteException JavaDoc
94    {
95    }
96
97    public void ejbActivate() throws EJBException JavaDoc, RemoteException JavaDoc
98    {
99    }
100
101    public void ejbPassivate() throws EJBException JavaDoc, RemoteException JavaDoc
102    {
103    }
104
105    public void ejbLoad() throws EJBException JavaDoc, RemoteException JavaDoc
106    {
107    }
108
109    public void ejbStore() throws EJBException JavaDoc, RemoteException JavaDoc
110    {
111    }
112 }
113
Popular Tags