Project

General

Profile

Revision d4afb9f7

IDd4afb9f7316991997bfd294af9a9c5f98e377247
Parent 755244f7
Child 09ed14f5

Added by Patrick Plitzner over 1 year ago

ref #8242 Ensure order of TermDTO query

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/TermDto.java
229 229
    }
230 230

  
231 231
    public static List<TermDto> termDtoListFrom(List<Object[]> results) {
232
        Map<UUID, TermDto> dtoMap = new HashMap<>(results.size());
232
        List<TermDto> dtos = new ArrayList<>(); // list to ensure order
233
        Map<UUID, TermDto> dtoMap = new HashMap<>(results.size()); // map to handle multiple representations
233 234
        for (Object[] elements : results) {
234 235
            UUID uuid = (UUID)elements[0];
235 236
            if(dtoMap.containsKey(uuid)){
......
260 261
                        (String)elements[6],
261 262
                        vocRepresentations);
262 263
                termDto.setUri((URI)elements[9]);
264

  
263 265
                dtoMap.put(uuid, termDto);
266
                dtos.add(termDto);
264 267
            }
265 268
        }
266
        return new ArrayList<>(dtoMap.values());
269
        return dtos;
267 270
    }
268 271

  
269 272
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)