if (ids.size() > LIMIT_FOR_IN) ids = null;
    public List retrieveImagesWithAnnotations(int datasetID,                                             ImageSummary retVal)        throws DSOutOfServiceException, DSAccessException    {        //Create a new dataObject if none provided.        //Object used as prototype.        if (retVal == null) retVal = new ImageSummary();        //Define the criteria by which the object graph is pulled out.        List datasetIDs = new ArrayList();        datasetIDs.add(new Integer(datasetID));        Criteria c = DatasetMapper.buildImagesCriteria(datasetIDs, null, null);        //Load the graph defined by criteria.        Dataset dataset = (Dataset) gateway.retrieveData(Dataset.class, c);        //List of image summary object.        List images = new ArrayList();        //Put the server data into the corresponding client object.        if (dataset == null) return images;        //Retrieve the user ID.        UserCredentials uc = (UserCredentials)                            registry.lookup(LookupNames.USER_CREDENTIALS);        List ids = DatasetMapper.prepareListImagesID(dataset);        if (ids.size() > LIMIT_FOR_IN) ids = null;        c = AnnotationMapper.buildImageAnnotationCriteria(ids, uc.getUserID());        //if (ids != null && ids.size() != 0) {        List l = (List) gateway.retrieveListSTSData("ImageAnnotation", c);        DatasetMapper.fillListAnnotatedImages(dataset, retVal, l, images);        //}          return images;    }