001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.bank.ejb;
023:
024: import java.util.*;
025:
026: import javax.naming.InitialContext;
027:
028: import org.jboss.test.util.ejb.EntitySupport;
029: import org.jboss.test.bank.interfaces.*;
030:
031: /**
032: *
033: * @author Rickard Oberg
034: * @author $Author: dimitris@jboss.org $
035: * @version $Revision: 57211 $
036: */
037: public class CustomerBean extends EntitySupport {
038: // Constants -----------------------------------------------------
039:
040: // Attributes ----------------------------------------------------
041: public String id;
042: public String name;
043: public Collection accounts;
044:
045: // Static --------------------------------------------------------
046:
047: // Constructors --------------------------------------------------
048:
049: // Public --------------------------------------------------------
050: public String getId() {
051: return id;
052: }
053:
054: public void setId(String id) {
055: this .id = id;
056: }
057:
058: public String getName() {
059: return name;
060: }
061:
062: public void setName(String name) {
063: this .name = name;
064: }
065:
066: public Collection getAccounts() {
067: return accounts;
068: }
069:
070: public void addAccount(Account acct) {
071: accounts.add(acct);
072: }
073:
074: public void removeAccount(Account acct) {
075: accounts.remove(acct);
076: }
077:
078: // EntityHome implementation -------------------------------------
079: public CustomerPK ejbCreate(String id, String name) {
080: setId(id);
081: setName(name);
082: accounts = new ArrayList();
083:
084: CustomerPK pk = new CustomerPK();
085: pk.id = id;
086: pk.name = name;
087:
088: return pk;
089: }
090:
091: public void ejbPostCreate(String id, String name) {
092: }
093: }
094:
095: /*
096: * $Id: CustomerBean.java 57211 2006-09-26 12:39:46Z dimitris@jboss.org $
097: * Currently locked by:$Locker$
098: * Revision:
099: * $Log$
100: * Revision 1.6.6.2 2005/10/29 05:04:33 starksm
101: * Update the LGPL header
102: *
103: * Revision 1.6.6.1 2005/04/06 16:25:03 starksm
104: * Fix the license header
105: *
106: * Revision 1.6 2003/08/27 04:32:49 patriot1burke
107: * 4.0 rollback to 3.2
108: *
109: * Revision 1.4 2001/01/20 16:32:51 osh
110: * More cleanup to avoid verifier warnings.
111: *
112: * Revision 1.3 2001/01/07 23:14:34 peter
113: * Trying to get JAAS to work within test suite.
114: *
115: * Revision 1.2 2000/09/30 01:00:54 fleury
116: * Updated bank tests to work with new jBoss version
117: *
118: * Revision 1.1.1.1 2000/06/21 15:52:37 oberg
119: * Initial import of jBoss test. This module contains CTS tests, some simple examples, and small bean suites.
120: *
121: *
122: *
123: */
|