// ProjectBean.java

package hr;

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

public abstract class ProjectBean implements EntityBean
{

    private EntityContext ectx;

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

    public abstract Integer getProjectNo();
    public abstract void setProjectNo(Integer projectNo);

    public abstract String getProjectName();
    public abstract void setProjectName(String projectName);

    // getters and setters for relationship fields
    // ===========================================================

    // m:m
    public abstract Collection getEmployees();
    public abstract void setEmployees(Collection employees);

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

    public Integer ejbCreate(Project project) throws CreateException
    {
        setProjectNo(project.getProjectNo());
        setProjectName(project.getProjectName());
        return null;
    }

    public void ejbPostCreate(Project project) 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;
    }

}
