BMP的HOME接口中的方法是全局的,可以返回任何类型。在BEAN中的方法名为
(ejbHome*),你只有一个ejbCreate()方法。CMP也可以

解决方案 »

  1.   

    cmp的home接口的返回值一般是一个remote接口或是包含一些remote接口的collection对象。一个cmp实例(可理解为一个remote接口)对应一个数据库记录,因此只能定义一些不跨记录的业务,想定义复杂业务还是用session bean在去调用cmp或是jdbc吧。
      

  2.   

    恩,楼上两位说的我大概都能理解。
    但是有谁能把这个问题说的全面透彻一点吗?包括EJB2.0规范
      

  3.   

    home method是在entity bean中特殊的方法,由于entity bean相当于数据库中某个单行记录的投影,所以通过接口暴露给客户都是查找,生成,删除(这些在home中),操作这个数据,更新,等(在EjbObejct的实现中),可是这都是针对某条记录,不能满足跨越单条记录的需求,于是产生了home method.(我的最大优点就是语文表述能力差,不知道,说清楚了没有..)
      

  4.   

    呵呵,谢谢楼上的解释,但我更想知道的是如何定义、实现、使用HOME METHOD?望指教一二。
      

  5.   

    Each home method definition in the home interface corresponds to a method in the entity bean class. In the home interface, the method name is arbitrary, provided that it does not begin with create or find. In the bean class, the matching method name begins with ejbHome. For example, in the SavingsAccountBean class the name is ejbHomeChargeForLowBalance, but in the SavingsAccountHome interface the name is chargeForLowBalance. The home method signature must follow the same rules specified for finder methods in the previous section (except that a home method does not throw a FinderException).