'Im using hibernate, I was planing to use a LinkedHashMap
to sort the elements,
but it doesnt work because i couldn't initialize as that, so Im making the sort from the controller, so it works, but not as well, this my method to sort.
public LinkedHashMap<String, Indicador> OrdenarMap(Map<String, Indicador> map) {
LinkedHashMap<String, Indicador> sortedMap = new LinkedHashMap<>();
map.entrySet()
.stream()
.sorted(Map.Entry.comparingByKey())
.forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));
return sortedMap;
}
I want the order like this
{1 Objetivo General, 1.1 Objetivo Especifico, 2 Objetivo General} etc....