Java 8 is not maintaining the order while grouping

Not maintaining the order is a property of the Map that stores the result. If you need a specific Map behavior, you need to request a particular Map implementation. E.g. LinkedHashMap maintains the insertion order: groupedResult = people.collect(Collectors.groupingBy( p -> new GroupingKey(p, groupByColumns), LinkedHashMap::new, Collectors.mapping((Map<String, Object> p) -> p, toList()))); By the way, there is … Read more

Getting the date from a ResultSet for use with java.time classes

Most database vendors don’t support JDBC 4.2 yet. This specification says that the new java.time-types like LocalDate will/should be supported using the existing methods setObject(…) and getObject(). No explicit conversion is required and offered (no API-change). A workaround for the missing support can be manual conversion as described on the Derby-mailing list. Something like: LocalDate … Read more