KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > cmrstress > ejb > ChildBean


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.cmrstress.ejb;
23
24 import javax.ejb.EntityBean JavaDoc;
25 import javax.ejb.EntityContext JavaDoc;
26 import javax.ejb.RemoveException JavaDoc;
27
28 import org.jboss.logging.Logger;
29
30 /**
31  * The problem child.
32  *
33  * This code is based upon the original test case provided by Andrew May.
34  *
35  * @version <tt>$Revision: 58115 $</tt>
36  * @author <a HREF="mailto:steve@resolvesw.com">Steve Coy</a>.
37  *
38  * @ejb.bean name="Child"
39  * type="CMP"
40  * cmp-version="2.x"
41  * view-type="local"
42  * jndi-name="cmrstress/Child"
43  * primkey-field="id"
44  * schema="Child"
45  *
46  * @ejb.pk class="java.lang.String"
47  * generate="false"
48  *
49  * @ejb.persistence table-name="StressedChild"
50  *
51  * @ejb.home generate="both"
52  * @ejb.interface generate="local"
53  *
54  * @ejb.transaction type="Supports"
55  *
56  * @jboss.persistence
57  * create-table="true"
58  * remove-table="true"
59  * @jboss.tuned-updates tune="true"
60  */

61 public abstract class ChildBean implements EntityBean JavaDoc
62 {
63    /**
64     * CMP get method for Id attribute.
65     * @ejb.interface-method view-type="local"
66     * @ejb.persistent-field
67     * @jboss.column-name name="id"
68     * jboss.method-attributes read-only="true"
69     */

70    public abstract String JavaDoc getId();
71
72    /**
73     * CMP set method for Id attribute.
74     * @ejb.interface-method view-type="local"
75     * @ejb.transaction type="Mandatory"
76     */

77    public abstract void setId(String JavaDoc id);
78    
79    /**
80     * CMP get method for Name attribute.
81     * @ejb.interface-method view-type="local"
82     * @ejb.persistent-field
83     * @jboss.column-name name="name"
84     * jboss.method-attributes read-only="true"
85     */

86    public abstract String JavaDoc getName();
87
88    /**
89     * CMP set method for Name attribute.
90     * @ejb.interface-method view-type="local"
91     * @ejb.transaction type="Mandatory"
92     */

93    public abstract void setName(String JavaDoc name);
94
95    /**
96     * CMP get method for Value attribute.
97     * @ejb.interface-method view-type="local"
98     * @ejb.persistent-field
99     * @jboss.column-name name="value"
100     * jboss.method-attributes read-only="true"
101     */

102    public abstract String JavaDoc getValue();
103
104    /**
105     * CMP set method for Value attribute.
106     * @ejb.interface-method view-type="local"
107     * @ejb.transaction type="Mandatory"
108     */

109    public abstract void setValue(String JavaDoc value);
110    
111    /**
112     * Create method for Entity.
113     * @ejb.create-method view-type="local"
114     * @ejb.transaction type="Mandatory"
115     */

116    public String JavaDoc ejbCreate(String JavaDoc id, String JavaDoc name, String JavaDoc value) throws javax.ejb.CreateException JavaDoc
117    {
118       msLog.debug("Created with pk: " + id);
119       setId(id);
120       setName(name);
121       setValue(value);
122       return null;
123    }
124
125    public void ejbPostCreate(String JavaDoc id, String JavaDoc name, String JavaDoc value)
126    {
127    }
128    
129    /**
130     * @see javax.ejb.EntityBean#ejbActivate()
131     */

132    public void ejbActivate()
133    {
134    }
135
136    /**
137     * @see javax.ejb.EntityBean#ejbLoad()
138     */

139    public void ejbLoad()
140    {
141    }
142
143    /**
144     * @see javax.ejb.EntityBean#ejbPassivate()
145     */

146    public void ejbPassivate()
147    {
148    }
149
150    /**
151     * @see javax.ejb.EntityBean#ejbRemove()
152     */

153    public void ejbRemove() throws RemoveException JavaDoc
154    {
155    }
156
157    /**
158     * @see javax.ejb.EntityBean#ejbStore()
159     */

160    public void ejbStore()
161    {
162    }
163
164    /**
165     * @see javax.ejb.EntityBean#setEntityContext(javax.ejb.EntityContext)
166     */

167    public void setEntityContext(EntityContext JavaDoc arg0)
168    {
169    }
170
171    /**
172     * @see javax.ejb.EntityBean#unsetEntityContext()
173     */

174    public void unsetEntityContext()
175    {
176    }
177
178    private static final Logger msLog = Logger.getLogger(ChildBean.class);
179
180 }
181
Popular Tags