public void AddKey(Key key){
  keys.add(key);
  if (key.getType() == Key.Primary) {
    primaryKey=key;
    purge(key.getColumns(),nonKeyColumns);
  }
 else   if (key.getType() == Key.Unique) {
    uniqueKeys.add(key);
  }
}

public void AddKey ( Key key ) { keys . add ( key ) ; if ( key . getType ( ) == Key . Primary ) { primaryKey = key ; purge ( key . getColumns ( ) , nonKeyColumns ) ; } else if ( key . getType ( ) == Key . Unique ) { uniqueKeys . add ( key ) ; } }
adds a key definition to the table . this method maintains non - key columns automatically , as well as unique keys .
