code: public synchronized int update (Connection conn, T obj, FieldMask mask)
          throws SQLException
      {
          int nUpdated = 0;
          String sql = "update " + name + " set " +
              (mask != null ? buildListOfAssignments(mask) : listOfAssignments) +
              buildUpdateWhere();
          PreparedStatement ustmt = conn.prepareStatement(sql);
          int column = bindUpdateVariables(ustmt, obj, mask);
          for (int i = 0; i < primaryKeys.length; i++) {
              int fidx = primaryKeyIndices[i];
              fields[fidx].bindVariable(ustmt, obj, column+i+1);
          }
          nUpdated = ustmt.executeUpdate();
          ustmt.close();
          return nUpdated;
      }
docs: Update record in the table using table's primary key to locate record in
  the table and values of fields of specified object <I>obj</I> to alter
  record fields. Only the fields marked as modified in the supplied field
  mask will be updated in the database.
  
  @param obj object specifying value of primary key and new values of
  updated record fields
  @param mask a {@link FieldMask} instance configured to indicate which of
  the object's fields are modified and should be written to the database.
  
  @return number of objects actually updated