@Transactional @Override public void update(Todo updated) { LOGGER.info("Updating todo: {}", updated); int updatedRowCount = jooq.update(TODOS) .set(TODOS.DESCRIPTION, updated.getDescription()) .set(TODOS.TITLE, updated.getTitle()) .where(TODOS.ID.equal(updated.getId())) .execute(); LOGGER.debug("Updated {} rows.", updatedRowCount); LOGGER.info("Todo: {} was updated", updated); }
@Transactional @Override public void updateAndThrowException(Todo updated) { LOGGER.info("Updating todo: {}", updated); int updatedRowCount = jooq.update(TODOS) .set(TODOS.DESCRIPTION, updated.getDescription()) .set(TODOS.TITLE, updated.getTitle()) .where(TODOS.ID.equal(updated.getId())) .execute(); LOGGER.debug("Updated {} rows.", updatedRowCount); LOGGER.info("Todo: {} was updated", updated); // This should throw a DataAccessException because the table 'foos' does not exist. jooq.select().from("foos").fetch(); }