一个Bean管理(BMP)的实体BEAN编译的问题,关于BEAN返回值类型的问题,请求您的帮助,谢谢!
package mytest;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import java.util.Collection;
public interface AccountHome
extends EJBLocalHome {
public Account create(String accountID, String ownerName) throws
CreateException;
public Account findByPrimaryKey(AccountPK key) throws FinderException;
^^^^^^^
public Collection findByOwnerName(String name) throws FinderException;
public double getTotalBankValue() throws AccountException;
}
这里的public Account findByPrimaryKey(AccountPK key) throws FinderException;
返回值类型不能为Account么?Account是EJBLocalObject对象,错误信息为:
(开发环境:JBuilder X)
=====================================================================
"EJBModule1.jar": [J2EE:160121]Errors encountered while compiling module 'D:\Documents and Settings\Administrator\jbproject\mystruts\EJBModule1.jar.jar':
"EJBModule1.jar": In EJB Account, the home interface findByPrimaryKey method parameter must be the primary key type or java.lang.Object: findByPrimaryKey(mytest.AccountPK)
"EJBModule1.jar": In EJB Account, the finder ejbFindByPrimaryKey(mytest.AccountPK) returned an unexpected type. Finders in the bean class must return the primary key type, java.util.Collection, or java.util.Enumeration
=====================================================================
请大家指教,谢谢!!