Пример #1
0
  @Override
  public void addColumn(IndexColumn indexColumn) {
    Table indexTable = indexColumn.getColumn().getTable();
    Integer indexTableDepth = indexTable.getDepth();
    assert indexTableDepth != null;

    super.addColumn(indexColumn);
    GroupIndexHelper.actOnGroupIndexTables(this, indexColumn, GroupIndexHelper.ADD);

    // Add the table into our navigable map if needed. Confirm it's within the branch
    ParticipatingTable participatingTable = tablesByDepth.get(indexTableDepth);
    if (participatingTable == null) {
      Map.Entry<Integer, ParticipatingTable> rootwardEntry =
          tablesByDepth.floorEntry(indexTableDepth);
      Map.Entry<Integer, ParticipatingTable> leafwardEntry =
          tablesByDepth.ceilingEntry(indexTableDepth);
      checkIndexTableInBranchNew(indexColumn, indexTable, indexTableDepth, rootwardEntry, true);
      checkIndexTableInBranchNew(indexColumn, indexTable, indexTableDepth, leafwardEntry, false);
      participatingTable = new ParticipatingTable(indexTable);
      tablesByDepth.put(indexTableDepth, participatingTable);
    } else if (participatingTable.table != indexTable) {
      throw new BranchingGroupIndexException(
          indexColumn.getIndex().getIndexName().getName(),
          indexTable.getName(),
          participatingTable.table.getName());
    }
    participatingTable.markInvolvedInIndex(indexColumn.getColumn());
  }
Пример #2
0
 public void disassociate() {
   GroupIndexHelper.actOnGroupIndexTables(this, GroupIndexHelper.REMOVE);
 }