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

3 Reasons why You Shouldn’t Replace Your for-loops by Stream.forEach()

Awesome! We're migrating our code base to Java 8. We'll replace everything by functions. Throw out design patterns. Remove object orientation. Right! Let's go! Wait a minute Java 8 has been out for over a year now, and the thrill has gone back to day-to-day business. A non-representative study executed by baeldung.com from May 2015 … Continue reading 3 Reasons why You Shouldn’t Replace Your for-loops by Stream.forEach()