Example #1
0
  /**
   * Updates column hint values by given axis attributes.
   *
   * @param outputAttrs the latest axis attributes
   * @param cachedOutputAttrs the last(cached) axis attributes
   * @param newHint the column hint
   */
  private static void updateColumnHintFromAxisAttrs(
      AxisAttributes axisAttributes, AxisAttributes cachedAxisAttributes, ColumnHint newHint) {
    if (axisAttributes == null) return;

    Object newValue = axisAttributes.getAxisType();
    Object oldValue = cachedAxisAttributes == null ? null : cachedAxisAttributes.getAxisType();
    if (!CompareUtil.isEquals(oldValue, newValue)) {
      newHint.setProperty(
          ColumnHint.ANALYSIS_MEMBER, convertAxisTypeToAnalysisType((AxisType) newValue));
    }

    newValue = axisAttributes.isOnColumnLayout();
    oldValue = cachedAxisAttributes == null ? null : cachedAxisAttributes.isOnColumnLayout();
    if (!CompareUtil.isEquals(oldValue, newValue)) {
      newHint.setProperty(ColumnHint.ON_COLUMN_LAYOUT_MEMBER, newValue);
    }

    newValue = axisAttributes.getRelatedColumns();
    oldValue = cachedAxisAttributes == null ? null : cachedAxisAttributes.getRelatedColumns();
    if (!CompareUtil.isEquals(oldValue, newValue)) {
      String analysisColumnName = null;
      DataElementIdentifiers columns = ((ResultSubset) newValue).getColumnIdentifiers();
      if (columns != null && !columns.getIdentifiers().isEmpty())
        analysisColumnName = columns.getIdentifiers().get(0).getName();
      newHint.setProperty(ColumnHint.ANALYSIS_COLUMN_MEMBER, analysisColumnName);
    }
  }
  /* (non-Javadoc)
   * @see org.eclipse.datatools.connectivity.oda.design.ResultSubset#addColumnIdentifier(org.eclipse.datatools.connectivity.oda.design.DataElementIdentifier)
   * @generated NOT
   */
  public void addColumnIdentifier(DataElementIdentifier columnIdentifier) {
    if (columnIdentifier == null) return; // nothing to add

    DataElementIdentifiers columns = getColumnIdentifiers();
    if (columns == null) {
      columns = DesignFactory.eINSTANCE.createDataElementIdentifiers();
      setColumnIdentifiers(columns);
    }
    columns.getIdentifiers().add(columnIdentifier);
  }