使用findBy***(...)之类的方法,返回一个Collection类型,Client端在得到返回的这个集合之后,使用
Iterator it = taxArray.iterator();
  while(it.hasNext()){
  Object objRef2 = it.next();
  tax = (Tax)PortableRemoteObject.narrow(objRef2, Tax.class);

  System.out.println("Tax Rate in " + tax.getPrimaryKey() + ": " +  tax.getTaxRate());
}
修改一下,就行了

解决方案 »

  1.   

    你的意思是说要在bean里定义一个数组吗?可要是数据量达到相当大的时候,这个数组会不会溢出?谢谢
      

  2.   

    collection 可以转化成 数组, 但是 不是 数组, 他自己管理容量的增减,
    一次只能访问其中的一条纪录,可以用iterator 或者 next()之类的方法遍例其中的所有纪录, 他返回的内容 要看 你的 find****方法在哪一个接口里面, 
    remotehome的话 返回 Entity Bean 的 远程接口集合
    Localhome的话 自己想,