WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.ejb20.relationships.many2many
Class CustomerBean

java.lang.Object
  |
  +--examples.ejb20.relationships.many2many.CustomerBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable

public abstract class CustomerBean
extends java.lang.Object
implements javax.ejb.EntityBean

Represents a customer and demonstrates many to many releationship with AccountBean.

Author:
Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.

Field Summary
(package private) static boolean VERBOSE
           
 
Constructor Summary
CustomerBean()
           
 
Method Summary
 void addAccount(Account acct)
          Adds Account.
 void ejbActivate()
           
 java.lang.String ejbCreate(java.lang.String name)
           
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreate(java.lang.String name)
           
 void ejbRemove()
           
 void ejbStore()
           
abstract  java.util.Collection getAccounts()
           
 java.util.Collection getAllAccounts()
          Returns serializable Collection of Accounts.
 double getBalance()
          Returns balance of associated accounts.
abstract  java.lang.String getName()
          container managed fields
 void removeAccount(Account acct)
          Removes Account.
abstract  void setAccounts(java.util.Collection accts)
           
 void setEntityContext(javax.ejb.EntityContext ctx)
          Sets the EntityContext for the EJBean.
abstract  void setName(java.lang.String val)
           
 void unsetEntityContext()
          Unsets the EntityContext for the EJBean.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

static final boolean VERBOSE
Constructor Detail

CustomerBean

public CustomerBean()
Method Detail

addAccount

public void addAccount(Account acct)
Adds Account.
Throws:
java.rmi.RemoteException - if there is a communications or systems failure

ejbActivate

public void ejbActivate()
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbCreate

public java.lang.String ejbCreate(java.lang.String name)
                           throws javax.ejb.CreateException

ejbLoad

public void ejbLoad()
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbPostCreate

public void ejbPostCreate(java.lang.String name)
                   throws javax.ejb.CreateException

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException
Specified by:
ejbRemove in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
Specified by:
ejbStore in interface javax.ejb.EntityBean

getAccounts

public abstract java.util.Collection getAccounts()

getAllAccounts

public java.util.Collection getAllAccounts()
Returns serializable Collection of Accounts.
Returns:
Collection
Throws:
java.rmi.RemoteException - if there is a communications or systems failure

getBalance

public double getBalance()
Returns balance of associated accounts.
Returns:
balance
Throws:
java.rmi.RemoteException - if there is a communications or systems failure

getName

public abstract java.lang.String getName()
container managed fields

removeAccount

public void removeAccount(Account acct)
Removes Account.
Throws:
java.rmi.RemoteException - if there is a communications or systems failure

setAccounts

public abstract void setAccounts(java.util.Collection accts)

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
Sets the EntityContext for the EJBean.
Specified by:
setEntityContext in interface javax.ejb.EntityBean
Parameters:
ctx - EntityContext

setName

public abstract void setName(java.lang.String val)

unsetEntityContext

public void unsetEntityContext()
Unsets the EntityContext for the EJBean.
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.