一个Bean管理(BMP)的实体BEAN编译的问题,关于BEAN返回值类型的问题,请求您的帮助,谢谢!

iStringTheory iStringTheory 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
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


=====================================================================

请大家指教,谢谢!!
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
iStringTheory
Java EE 67,535 成员 225,843 内容