code: public T update(T entity) throws RowNotFoundException, OptimisticLockException {
  
          if (!hasPrimaryKey(entity)) {
              throw new RuntimeException(String.format("Tried to update entity of type %s without a primary key", entity
                      .getClass().getSimpleName()));
          }
  
          UpdateCreator update = new UpdateCreator(table);
  
          update.whereEquals(idColumn.getColumnName(), getPrimaryKey(entity));
  
          if (versionColumn != null) {
              update.set(versionColumn.getColumnName() + " = " + versionColumn.getColumnName() + " + 1");
              update.whereEquals(versionColumn.getColumnName(), getVersion(entity));
          }
  
          for (Column column : columns) {
              if (!column.isReadOnly()) {
                  update.setValue(column.getColumnName(), getFieldValueAsColumn(entity, column));
              }
          }
  
          int rows = new JdbcTemplate(ormConfig.getDataSource()).update(update);
  
          if (rows == 1) {
  
              if (versionColumn != null) {
                  ReflectionUtils.setFieldValue(entity, versionColumn.getFieldName(), getVersion(entity) + 1);
              }
  
              return entity;
  
          } else if (rows > 1) {
  
              throw new RuntimeException(
                      String.format("Updating table %s with id %s updated %d rows. There must be a mapping problem. Is column %s really the primary key?",
                              table, getPrimaryKey(entity), rows, idColumn));
  
          } else {
  
              //
              // Updated zero rows. This could be because our ID is wrong, or
              // because our object is out-of date. Let's try querying just by ID.
              //
  
              SelectCreator selectById = new SelectCreator()
              .column("count(*)")
              .from(table)
              .whereEquals(idColumn.getColumnName(), getPrimaryKey(entity));
  
              rows = new JdbcTemplate(ormConfig.getDataSource()).query(selectById, new ResultSetExtractor<Integer>() {
                  @Override
                  public Integer extractData(ResultSet rs) throws SQLException, DataAccessException {
                      rs.next();
                      return rs.getInt(1);
                  }
              });
  
              if (rows == 0) {
                  throw new RowNotFoundException(table, getPrimaryKey(entity));
              } else {
                  throw new OptimisticLockException(table, getPrimaryKey(entity));
              }
          }
      }
docs: Updates value of entity in the table.