WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.ejb20.relationships.one2many
Class CustomerBean

java.lang.Object
  |
  +--examples.ejb20.relationships.one2many.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 one 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, int age, java.lang.Integer level, java.sql.Date lastDate)
           
 void ejbLoad()
           
 void ejbPassivate()
           
 void ejbPostCreate(java.lang.String name, int age, java.lang.Integer level, java.sql.Date lastDate)
           
 void ejbRemove()
           
 void ejbStore()
           
abstract  java.util.Collection getAccounts()
           
abstract  int getAge()
           
 java.util.Collection getAllAccounts()
          Returns serializable Collection of Accounts.
abstract  java.sql.Date getLastContact()
           
abstract  java.lang.Integer getLevelOfImportance()
           
abstract  java.lang.String getName()
          container managed fields
abstract  void setAccounts(java.util.Collection accts)
           
abstract  void setAge(int val)
           
 void setEntityContext(javax.ejb.EntityContext ctx)
          Sets the EntityContext for the EJBean.
abstract  void setLastContact(java.sql.Date val)
           
abstract  void setLevelOfImportance(java.lang.Integer val)
           
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,
                                  int age,
                                  java.lang.Integer level,
                                  java.sql.Date lastDate)
                           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,
                          int age,
                          java.lang.Integer level,
                          java.sql.Date lastDate)
                   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()

getAge

public abstract int getAge()

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

getLastContact

public abstract java.sql.Date getLastContact()

getLevelOfImportance

public abstract java.lang.Integer getLevelOfImportance()

getName

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

setAccounts

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

setAge

public abstract void setAge(int val)

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

setLastContact

public abstract void setLastContact(java.sql.Date val)

setLevelOfImportance

public abstract void setLevelOfImportance(java.lang.Integer val)

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.