package ejava.examples.personnel.ejb20;

import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Set;
import java.util.Collection;

/**
   This interface defines the local lifecycle and home methods for the Person 
   bean.
*/
public interface PersonLocalHome extends EJBLocalHome {
   /**
      This method creates an empty person that can be later populated with
      values.
   */
   PersonLocal create(String id) 
      throws CreateException;

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

   PersonLocal findByPrimaryKey(PersonPK pkey) 
      throws FinderException;
   
   PersonLocal findByName(String firstName, String lastName) 
      throws FinderException;
   
   Collection findAll() 
      throws FinderException;

   Collection findByAddress(String address) 
      throws FinderException;
   
   Set getPhoneNumbers() throws FinderException;
}
