package ejava.ejb.personnel;

import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.rmi.RemoteException;
import java.util.Collection;

/**
   This interface defines the lifecycle methods for the Person bean to create
   and find instances.
*/
public interface PersonHome extends EJBHome {
   /**
      This method creates an empty person that can be later populated with
      values.
   */
   Person create(String id) 
      throws CreateException, RemoteException;

   /**
      This method creates a fully populated person.
   */
   Person create(String id,
      String firstName, String lastName, String address, String phoneNumber) 
      throws CreateException, RemoteException;

   Person findByPrimaryKey(PersonPK pkey) 
      throws FinderException, RemoteException;
   
   Collection findByLikeName(String firstName, String lastName) 
      throws FinderException, RemoteException;
}
