A Hidden jOOQ Gem: Foreach Loop Over ResultQuery

A recent question on Stack Overflow about jOOQ caught my attention. The question essentially asked: Why do both of these loops work? // With fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN) .fetch()) { // fetch() here doThingsWithRecord(rec); } // Without fetch() for (MyTableRecord rec : DSL .using(configuration) .selectFrom(MY_TABLE) .orderBy(MY_TABLE.COLUMN)) { // No fetch() … Continue reading A Hidden jOOQ Gem: Foreach Loop Over ResultQuery

Really Too Bad that Java 8 Doesn’t Have Iterable.stream()

This is one of the more interesting recent Stack Overflow questions: Why does Iterable not provide stream() and parallelStream() methods? At first, it might seem intuitive to make it straight-forward to convert an Iterable into a Stream, because the two are really more or less the same thing for 90% of all use-cases. Granted, the … Continue reading Really Too Bad that Java 8 Doesn’t Have Iterable.stream()