KickJava   Java API By Example, From Geeks To Geeks.

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


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
30
31 /**
32  * @ejb.bean
33  * name="B"
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="B"
41  * @jboss.persistence
42  * datasource="${ds.name}"
43  * datasource-mapping="${ds.mapping}"
44  * create-table="${jboss.create.table}"
45  * remove-table="${jboss.remove.table}"
46  * @ejb:transaction type="Required"
47  */

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

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

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

71    public abstract void setName(String JavaDoc id);
72
73    /**
74     * @ejb.interface-method
75     * @ejb.relation
76     * name="A-B"
77     * role-name="B-has-A"
78     * @jboss.relation
79     * fk-constraint="false"
80     * related-pk-field="id"
81     * fk-column="a_id"
82     */

83    public abstract ALocal getA();
84    /**
85     * @ejb.interface-method
86     */

87    public abstract void setA(ALocal a);
88
89    /**
90     * @ejb.create-method
91     * @throws javax.ejb.CreateException
92     */

93    public BPK ejbCreate(Integer JavaDoc id, String JavaDoc name)
94       throws CreateException JavaDoc
95    {
96       setId(id);
97       setName(name);
98       return null;
99    }
100
101    public void ejbPostCreate(Integer JavaDoc id, String JavaDoc name)
102    {
103    }
104
105    /**
106     * @param ctx The new entityContext value
107     */

108    public void setEntityContext(EntityContext JavaDoc ctx)
109    {
110    }
111
112    /**
113     * Unset the associated entity context.
114     */

115    public void unsetEntityContext()
116    {
117    }
118
119    public void ejbActivate()
120    {
121    }
122
123    public void ejbLoad()
124    {
125    }
126
127    public void ejbPassivate()
128    {
129    }
130
131    public void ejbRemove() throws RemoveException JavaDoc
132    {
133    }
134
135    public void ejbStore()
136    {
137    }
138 }
139
Popular Tags