jOOQ record mappers
Sometimes, we need a custom mapping that cannot be achieved via the fetchInto()
method, the fetchMap()
method, the fetchGroups()
method, or the Records
utility. A simple approach relies on Iterable.forEach(Consumer)
, as shown in the following mapping:
ctx.select(EMPLOYEE.FIRST_NAME, EMPLOYEE.LAST_NAME, EMPLOYEE.EMAIL) .from(EMPLOYEE) .forEach((Record3<String, String, String> record) -> { System.out.println("\n\nTo: " + record.getValue(EMPLOYEE.EMAIL)); System.out.println("From: " + "[email protected]"); System.out.println("Body: \n Dear, " + record...