@Transactional(readOnly = true) @Override public Todo findById(Long id) { LOGGER.info("Finding todo by id: {}", id); TodosRecord queryResult = jooq.selectFrom(TODOS).where(TODOS.ID.equal(id)).fetchOne(); LOGGER.debug("Got result: {}", queryResult); if (queryResult == null) { throw new NotFoundException("No todo found with id: " + id); } return Todo.getBuilder(queryResult.getTitle()) .description(queryResult.getDescription()) .id(queryResult.getId()) .build(); }