KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > bank > ejb > CustomerBean


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.bank.ejb;
23
24 import java.util.*;
25
26 import org.jboss.test.util.ejb.EntitySupport;
27 import org.jboss.test.bank.interfaces.*;
28
29 /**
30  *
31  * @see <related>
32  * @author $Author: starksm $
33  * @version $Revision: 41967 $
34  */

35 public class CustomerBean
36    extends EntitySupport
37 {
38    // Constants -----------------------------------------------------
39

40    // Attributes ----------------------------------------------------
41
public String JavaDoc id;
42    public String JavaDoc name;
43    public Collection accounts;
44    
45    // Static --------------------------------------------------------
46

47    // Constructors --------------------------------------------------
48

49    // Public --------------------------------------------------------
50
public String JavaDoc getId()
51    {
52       return id;
53    }
54    
55    public void setId(String JavaDoc id)
56    {
57       this.id = id;
58    }
59    
60    public String JavaDoc getName()
61    {
62       return name;
63    }
64    
65    public void setName(String JavaDoc name)
66    {
67       this.name = name;
68    }
69    
70    public Collection getAccounts()
71    {
72         return accounts;
73    }
74    
75    public void addAccount(Account acct)
76    {
77         accounts.add(acct);
78    }
79    
80    public void removeAccount(Account acct)
81    {
82         accounts.remove(acct);
83    }
84    
85    // EntityHome implementation -------------------------------------
86
public CustomerPK ejbCreate(String JavaDoc id, String JavaDoc name)
87    {
88       setId(id);
89       setName(name);
90       accounts = new ArrayList();
91       
92       CustomerPK pk = new CustomerPK();
93       pk.id = id;
94       pk.name = name;
95
96       return pk;
97    }
98    
99    public void ejbPostCreate(String JavaDoc id, String JavaDoc name)
100    {
101    }
102 }
103
104 /*
105  * $Id: CustomerBean.java 41967 2006-03-09 05:07:05Z starksm $
106  * Currently locked by:$Locker$
107  * Revision:
108  * $Log$
109  * Revision 1.8 2006/03/09 05:07:05 starksm
110  * cleanup unused imports
111  *
112  * Revision 1.7 2005/10/29 23:41:15 starksm
113  * Update the jboss LGPL headers
114  *
115  * Revision 1.6 2003/08/27 04:32:49 patriot1burke
116  * 4.0 rollback to 3.2
117  *
118  * Revision 1.4 2001/01/20 16:32:51 osh
119  * More cleanup to avoid verifier warnings.
120  *
121  * Revision 1.3 2001/01/07 23:14:34 peter
122  * Trying to get JAAS to work within test suite.
123  *
124  * Revision 1.2 2000/09/30 01:00:54 fleury
125  * Updated bank tests to work with new jBoss version
126  *
127  * Revision 1.1.1.1 2000/06/21 15:52:37 oberg
128  * Initial import of jBoss test. This module contains CTS tests, some simple examples, and small bean suites.
129  *
130  *
131  *
132  */

133
Popular Tags