Esempio n. 1
0
  /**
   * Return the column which is identified by column provided as argument.
   *
   * @param column column with atleast a name.
   * @return the underlying column or null if not inside this table. Note: the instance *can* be
   *     different than the input parameter, but the name will be the same.
   */
  public Column getColumn(Column column) {
    if (column == null) return null;

    Column myColumn = (Column) columns.get(column.getCanonicalName());

    return column.equals(myColumn) ? myColumn : null;
  }
Esempio n. 2
0
  private List columnMatches(Column[] myPkColumns, int offset, ForeignKey key) {

    if (key.getColumnSpan() > (myPkColumns.length - offset)) {
      return null; // not enough columns in the key
    }

    List columns = new ArrayList();
    for (int j = 0; j < key.getColumnSpan(); j++) {
      Column column = myPkColumns[j + offset];
      if (!column.equals(key.getColumn(j))) {
        return null;
      } else {
        columns.add(column);
      }
    }
    return columns.isEmpty() ? null : columns;
  }