users@glassfish.java.net

Re: Infinite XML Loop

From: <glassfish_at_javadesktop.org>
Date: Wed, 17 Oct 2007 09:37:08 PDT

Sahoo

Here is my stateless Session Bean


@Stateless
@WebService
public class ValidAppStatusFacade implements ValidAppStatusFacadeLocal {

    @PersistenceContext
    private EntityManager em;
    
    /** Creates a new instance of ValidAppStatusFacade */
    public ValidAppStatusFacade() {
    }

    
    public List findAll() {
  
      List list = (List)em.createQuery("select object(o) from ValidAppStatus as o").getResultList();
        for(Iterator<ValidAppStatus> i = list.iterator(); i.hasNext(); ){
            ValidAppStatus validApp = i.next();
                    for(Application application:validApp.getApplicationCollection()){
                         application.applicationStatus = null; //break cycle -- How do i detach applicationSttaus from application
                    }
        }
        return list;
       
    }
}

Sorry, how can i detach applicationStatus in the above method.

Thanks
[Message sent by forum member 'ad1900' (ad1900)]

http://forums.java.net/jive/thread.jspa?messageID=240705