Пример #1
0
  public LogicalColumn findLogicalColumn(IPhysicalColumn column, ModelerPerspective perspective) {
    LogicalColumn col = null;
    IPhysicalTable physicalTable = column.getPhysicalTable();
    LogicalModel logicalModel = this.getLogicalModel(perspective);
    if (logicalModel == null) {
      return col;
    }
    for (LogicalTable table : logicalModel.getLogicalTables()) {
      if (table.getPhysicalTable().getId().equals(physicalTable.getId())) {
        if ((perspective == ModelerPerspective.ANALYSIS
                && table.getId().endsWith(BaseModelerWorkspaceHelper.OLAP_SUFFIX))
            || (perspective == ModelerPerspective.REPORTING
                && !table.getId().endsWith(BaseModelerWorkspaceHelper.OLAP_SUFFIX))) {

          for (LogicalColumn lCol : table.getLogicalColumns()) {
            if (lCol.getPhysicalColumn().getId().equals(column.getId())) {
              return lCol;
            }
          }
        }
      }
    }

    return col;
  }
Пример #2
0
  public boolean isSameUnderlyingPhysicalColumn(IPhysicalColumn column) {
    IPhysicalTable table = column.getPhysicalTable();

    return getPhysicalColumn().getId().equals(column.getId())
        && getPhysicalColumn().getPhysicalTable().getId().equals(table.getId());
  }