customerhome.java

来自「精通EJB3.0一书的全部随书实例的源代码。」· Java 代码 · 共 66 行

JAVA
66
字号
package examples;

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

/**
 * This is the local home interface for our entity bean.
 * The container will implement this as the home object,
 * which serves as a factory for EJB Objects.
 */
public interface CustomerHome 
    extends EJBLocalHome 
{

    /*
     * This method creates the EJB Object.
     *
     * Notice that this create returns an
     * EJB Object, whereas the bean's ejbCreate returns a PK.
     * This is because the EJB Container is responsible
     * for generating the EJB Object, whereas the Bean
     * is responsible for initialization.
     *
     * @param id of the customer
     * @param name of the customer
     * @param password of the customer
     * @param address of the customer
     */
	 
    Customer create(String customerID, String name, String password, String address) 
        throws CreateException;
    
    // Finder methods, implemented by container due to CMP

    /**
     * Returns the customer local object.
     * @param customer id
     */
    public Customer findByPrimaryKey(String key) 
        throws FinderException;
    
    /**
     * Returns a collection of customer local objects for the given name
     * @param name of the customer
     */
    public Collection findByName(String name)
        throws FinderException;
     
    /**
     * Returns a collection of customer local objects for the given address
     * @param address of the customer
     */
    public Collection findByAddress(String address) 
        throws FinderException;
    
    /**
     * Returns  a collection all customer local objects.
     */
    public Collection findAllCustomers() 
        throws FinderException;

    // Home business method, independent of any particular instance
    //public double getTotalNumberOfCustomers();

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?