KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cmp2 > jbas1361 > ABean


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.jbas1361;
23
24
25 import javax.ejb.EntityBean JavaDoc;
26 import javax.ejb.EntityContext JavaDoc;
27 import javax.ejb.RemoveException JavaDoc;
28 import javax.ejb.CreateException JavaDoc;
29 import java.util.Collection JavaDoc;
30
31
32 /**
33  * @ejb.bean name="A"
34  * type="CMP"
35  * cmp-version="2.x"
36  * view-type="local"
37  * reentrant="false"
38  * @ejb.pk generate="true"
39  * @ejb.util generate="physical"
40  * @ejb.persistence table-name="A"
41  * @jboss.persistence datasource="${ds.name}"
42  * datasource-mapping="${ds.mapping}"
43  * create-table="${jboss.create.table}"
44  * remove-table="${jboss.remove.table}"
45  * pk-constraint="true"
46  * @ejb:transaction type="Required"
47  */

48 public abstract class ABean implements EntityBean JavaDoc
49 {
50    // CMP accessors --------------------------------------------
51
/**
52     * @ejb.pk-field
53     * @ejb.persistent-field
54     * @ejb.interface-method
55     */

56    public abstract Integer JavaDoc getId();
57
58    public abstract void setId(Integer JavaDoc id);
59
60    /**
61     * @ejb.persistent-field
62     * @ejb.interface-method
63     */

64    public abstract String JavaDoc getName();
65
66   /**
67    * @ejb.interface-method
68    */

69    public abstract void setName(String JavaDoc name);
70
71    /**
72     * @ejb.interface-method
73     * @ejb.relation name="A-B"
74     * role-name="A-has-B"
75     */

76    public abstract Collection JavaDoc getB();
77
78    /**
79     * @ejb.interface-method
80     */

81    public abstract void setB(Collection JavaDoc b);
82
83    /**
84     * @throws javax.ejb.CreateException
85     * @ejb.create-method
86     */

87    public Integer JavaDoc ejbCreate(Integer JavaDoc id, String JavaDoc name)
88       throws CreateException JavaDoc
89    {
90       setId(id);
91       setName(name);
92       return null;
93    }
94
95    public void ejbPostCreate(Integer JavaDoc id, String JavaDoc name)
96    {
97    }
98
99    /**
100     * @param ctx The new entityContext value
101     */

102    public void setEntityContext(EntityContext JavaDoc ctx)
103    {
104    }
105
106    /**
107     * Unset the associated entity context.
108     */

109    public void unsetEntityContext()
110    {
111    }
112
113    public void ejbActivate()
114    {
115    }
116
117    public void ejbLoad()
118    {
119    }
120
121    public void ejbPassivate()
122    {
123    }
124
125    public void ejbRemove() throws RemoveException JavaDoc
126    {
127    }
128
129    public void ejbStore()
130    {
131    }
132 }
133
Popular Tags