public void update(Object updated) throws ValidationFailureException, EntityNotFoundException { log.debug(format("Updating [%s] - %s", updated.getClass().getSimpleName(), updated.toString())); validator.validateUpdate(updated); Object original = query.findById(updated.getClass(), getPrimaryValueAsLong(updated)); SQLGenerator sql = new SQLGenerator(); execute(sql.getUpdateSQL(original, updated)); }
public void delete(Object o) throws ValidationFailureException { log.debug(format("Deleting [%s] - %s", o.getClass().getSimpleName(), o.toString())); validator.validateDelete(o); SQLGenerator sql = new SQLGenerator(); execute(sql.getDeleteSQL(o)); }