EOEditingContext ec = ERXExtensions.newEditingContext(); NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug", "BugsToTransfert", null); for(Enumeration e = bugs.objectEnumerator(); e.hasMoreElements();){ Bug bug = (Bug)e.nextElement(); System.out.println("bug = "+bug.valueForKey("subject")); String description = (String)bug.valueForKey("textDescription"); bug.takeValueForKey(description, "textDescription"); ec.saveChanges();
EOEditingContext ec = ERXEC.newEditingContext(); ec.lock(); try { NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug", "BugsToTransfert", null); for(Enumeration e = bugs.objectEnumerator(); e.hasMoreElements();){ Bug bug = (Bug)e.nextElement(); System.out.println("bug = "+bug.valueForKey("subject")); String description = (String)bug.valueForKey("textDescription"); bug.takeValueForKey(description, "textDescription"); ec.saveChanges(); } } finally { ec.unlock();
    public WOComponent transfertDescriptionAction(){        EOEditingContext ec = ERXExtensions.newEditingContext();        NSArray bugs = EOUtilities.objectsWithFetchSpecificationAndBindings(ec, "Bug",                                                                            "BugsToTransfert", null);        for(Enumeration e = bugs.objectEnumerator(); e.hasMoreElements();){            Bug bug = (Bug)e.nextElement();            System.out.println("bug = "+bug.valueForKey("subject"));            String description = (String)bug.valueForKey("textDescription");            bug.takeValueForKey(description, "textDescription");            ec.saveChanges();        }        return null;    }