Topic: 【EJB2.0】关于客户端+SessionBean+CMP调用的问题

  Print this page

1.【EJB2.0】关于客户端+SessionBean+CMP调用的问题 Copy to clipboard
Posted by: bson
Posted on: 2008-02-15 15:49

先说说几个层次的情况:
CMP:本地接口
SessionBean:远程接口
客户端:调用SessionBean

以Oracle,scott的Emp表为例:
我要查询所有,EmpHome提供方法:
Public List findByAll();
//EJBQL是:Select Object ( c ) from Emp as c


在SessionBean通过

Collection col = empHome.findByAll();
Iterator it = col.iterator();
while (it.hasNext()) {
Emp emp = (Emp) PortableRemoteObject.narrow(it.next(), Emp.class);
}

是可以得到查询结果。但是SessionBean应该怎样把结果返回给客户端呢?客户端又没办法获得CMP的接口……请高手指点!!!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923