package ejava.examples.personnel.ejb20;

import ejava.examples.personnel.Person;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.rmi.RemoteException;
import java.util.Set;
import java.util.Collection;

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

   /**
      This method creates a fully populated person.
   */
   PersonRemote create(Person values)
      throws CreateException, RemoteException;

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

   Collection findByAddress(String address) 
      throws FinderException, RemoteException;

   Set getPhoneNumbers() throws FinderException, RemoteException;
}
