// AddressBean.java

package hr;

import javax.ejb.*;
import java.rmi.*;
import java.util.*;

public abstract class AddressBean implements EntityBean
{

    private EntityContext ectx;

    // getters and setters for cmp fields
    // ===========================================================

    public abstract String getStreet();
    public abstract void setStreet(String street);

    public abstract String getCity();
    public abstract void setCity(String city);

    public abstract String getState();
    public abstract void setState(String state);

    public abstract String getZip();
    public abstract void setZip(String zip);

    // ===========================================================

    public Object ejbCreate(Address address) throws CreateException
    {
        setStreet(address.getStreet());
        setCity(address.getCity());
        setState(address.getState());
        setZip(address.getZip());
        return null;
    }

    public void ejbPostCreate(Address address)
        throws CreateException
    {
        // when just after bean created
    }

    public void ejbStore()
    {
        // when bean persisted
    }

    public void ejbLoad()
    {
        // when bean loaded
    }

    public void ejbRemove()
    {
        // when bean removed
    }

    public void ejbActivate()
    {
        // when bean activated
    }

    public void ejbPassivate()
    {
        // when bean deactivated
    }

    public void setEntityContext(EntityContext ectx)
    {
        this.ectx = ectx;
    }

    public void unsetEntityContext()
    {
        this.ectx = null;
    }

}
