KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > banknew > ejb > BankBean


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.banknew.ejb;
23
24 import javax.ejb.CreateException JavaDoc;
25
26 import org.jboss.test.banknew.interfaces.BankData;
27 import org.jboss.test.banknew.interfaces.BankPK;
28 import org.jboss.test.util.ejb.EntitySupport;
29
30 /**
31  * The Session bean represents a bank.
32  *
33  * @author Andreas Schaefer
34  * @version $Revision: 41581 $
35  *
36  * @ejb:bean name="bank/Bank"
37  * display-name="Bank Entity"
38  * type="CMP"
39  * view-type="remote"
40  * jndi-name="ejb/bank/Bank"
41  * schema="Bank"
42  *
43  * @ejb:interface extends="javax.ejb.EJBObject"
44  *
45  * @ejb:home extends="javax.ejb.EJBHome"
46  *
47  * @ejb:pk extends="java.lang.Object"
48  *
49  * @ejb:data-object extends="java.lang.Object"
50  * generate="true"
51  *
52  * @ejb:finder signature="java.util.Collection findAll()"
53  * query="SELECT OBJECT(o) FROM Bank AS o"
54  *
55  * @ejb:transaction type="Required"
56  *
57  * @jboss:table-name table-name="New_Bank"
58  *
59  * @jboss:create-table create="true"
60  *
61  * @jboss:remove-table remove="true"
62  */

63 public abstract class BankBean
64    extends EntitySupport
65 {
66    // Constants -----------------------------------------------------
67

68    // Attributes ----------------------------------------------------
69

70    // Static --------------------------------------------------------
71

72    // Constructors --------------------------------------------------
73

74    // Public --------------------------------------------------------
75

76    /**
77     * @ejb:persistent-field
78     * @ejb:pk-field
79     *
80     * @jboss:column-name name="Id"
81     **/

82    public abstract String JavaDoc getId();
83    
84    public abstract void setId( String JavaDoc pId );
85    
86    /**
87     * @ejb:persistent-field
88     *
89     * @jboss:column-name name="Name"
90     **/

91    public abstract String JavaDoc getName();
92    
93    public abstract void setName( String JavaDoc pName );
94    
95    /**
96     * @ejb:persistent-field
97     *
98     * @jboss:column-name name="Address"
99     **/

100    public abstract String JavaDoc getAddress();
101    
102    public abstract void setAddress( String JavaDoc pAddress );
103    
104    /**
105     * @ejb:interface-method view-type="remote"
106     **/

107    public abstract void setData( BankData pData );
108    
109    /**
110     * @ejb:interface-method view-type="remote"
111     **/

112    public abstract BankData getData();
113    
114    // EntityBean implementation -------------------------------------
115

116    /**
117     * @ejb:create-method view-type="remote"
118     **/

119    public BankPK ejbCreate( String JavaDoc pName, String JavaDoc pAddress )
120       throws CreateException JavaDoc
121    {
122       setId( "Bank ( " + System.currentTimeMillis() + " )" );
123       setName( pName );
124       setAddress( pAddress );
125       
126       return null;
127    }
128    
129    public void ejbPostCreate( String JavaDoc pName, String JavaDoc pAddress )
130       throws CreateException JavaDoc
131    {
132    }
133 }
134
135 /*
136  * $Id: BankBean.java 41581 2006-03-01 16:10:00Z adrian $
137  * Currently locked by:$Locker$
138  * Revision:
139  * $Log$
140  * Revision 1.4 2006/03/01 16:09:58 adrian
141  * Remove xdoclet from jca tests
142  *
143  * Revision 1.2.16.1 2005/10/29 05:04:35 starksm
144  * Update the LGPL header
145  *
146  * Revision 1.2 2002/05/06 00:07:37 danch
147  * Added ejbql query specs, schema names
148  *
149  * Revision 1.1 2002/05/04 01:08:25 schaefera
150  * Added new Stats classes (JMS related) to JSR-77 implemenation and added the
151  * bank-new test application but this does not work right now properly but
152  * it is not added to the default tests so I shouldn't bother someone.
153  *
154  * Revision 1.1.2.5 2002/04/30 01:21:23 schaefera
155  * Added some fixes to the marathon test and a windows script.
156  *
157  * Revision 1.1.2.4 2002/04/29 21:05:17 schaefera
158  * Added new marathon test suite using the new bank application
159  *
160  * Revision 1.1.2.3 2002/04/17 05:07:24 schaefera
161  * Redesigned the banknew example therefore to a create separation between
162  * the Entity Bean (CMP) and the Session Beans (Business Logic).
163  * The test cases are redesigned but not finished yet.
164  *
165  */

166
Popular Tags