FileDocCategorySizeDatePackage
PersonBean.javaAPI DocExample2951Wed Apr 05 11:25:42 BST 2000entity.containerManaged

PersonBean

public class PersonBean extends Object implements EntityBean
A PersonBean, which represents a person stored in our database.

Fields Summary
public String
mFirstName
public String
mLastName
private transient EntityContext
mContext
Constructors Summary
Methods Summary
public voidejbActivate()
No need for us to activate anything in this bean, but we need to provide an implementation.


                      
     
    System.out.println("ProfileBean activated.");
  
public voidejbCreate(java.lang.String fname, java.lang.String lname)
Create method with name of person.

    mFirstName = fname;
    mLastName = lname;
  
public voidejbCreate()
Create method (corresponds to each create() method on the home interface). Nothing to initialize in this case.

    System.out.println("Nameless PersonBean created.");
  
public voidejbLoad()
Load bean from persistent store. Container is doing this for us, so nothing to do here.

public voidejbPassivate()
No state to store on passivation (it's all in persistenct storage).

public voidejbPostCreate(java.lang.String fname, java.lang.String lname)
Post-creation notification. Nothing to do here, what we need to provide an implementation.

public voidejbPostCreate()
Post-creation notification. Nothing to do here, but we need to provide an implementation.

    System.out.println("PersonBean post-create called.");
  
public voidejbRemove()
Nothing to do on a remove.

public voidejbStore()
Store bean to persistent store. Container is doing this, so nothing to do here, either.

public java.lang.StringgetFirstName()

    return mFirstName;
  
public java.lang.StringgetLastName()

    return mLastName;
  
public voidsetEntityContext(EntityContext context)
Get context from container.

    mContext = context;
  
public voidunsetEntityContext()
Container is removing our context.

    mContext = null;