Discussions

EJB programming & troubleshooting: How to process a Collection?

  1. How to process a Collection? (2 messages)

    my finder in entitybean return a Collection to client,how can the client process the Collection to get every bean instance?
  2. How to process a Collection?[ Go to top ]

    Refer to the code snippet:

    ...
    Collection orders = home.findByCustomer( customerId );
    for( Iterator iter = orders.iterator(); iter.hasNext(); ) {
       Object objRef = iter.next();
       Order order = (Order) PortableRemoteObject.narrow( objRef, com.acme.ejb.Order.class );
    ...
    }
  3. How to process a Collection?[ Go to top ]

    You can Process Like this

      Iterator it = collection.iterator();
      while (it.hasNext())
       {
        EjbComponent.CreateObject Ecustpo =(EjbComponent.CreateObject)it.next();
            String strPonumber = Ecustpo.getCustPo();
            Integer strRev = Ecustpo.getRevNo();
       }
    Here CreateObject is supposed to be a Java Object, implements Java.io.serializable.