Search in sources :

Example 6 with JoinRelationshipModel

use of org.pentaho.agilebi.modeler.models.JoinRelationshipModel in project data-access by pentaho.

the class JoinValidator method notDuplicate.

private boolean notDuplicate(JoinRelationshipModel newJoin) {
    boolean notDuplicate = true;
    for (JoinRelationshipModel join : this.joinGuiModel.getJoins()) {
        if (newJoin.equals(join)) {
            notDuplicate = false;
            this.error = new JoinError(MessageHandler.getString("multitable.DUPLICATE_JOIN_TITLE"), MessageHandler.getString("multitable.DUPLICATE_JOIN_ERROR"));
            break;
        }
    }
    return notDuplicate;
}
Also used : JoinRelationshipModel(org.pentaho.agilebi.modeler.models.JoinRelationshipModel)

Example 7 with JoinRelationshipModel

use of org.pentaho.agilebi.modeler.models.JoinRelationshipModel in project data-access by pentaho.

the class MultitableGuiModel method generateLogicalRelationships.

@Deprecated
public List<LogicalRelationship> generateLogicalRelationships(List<JoinRelationshipModel> joins) {
    String locale = LocalizedString.DEFAULT_LOCALE;
    List<LogicalRelationship> logicalRelationships = new ArrayList<LogicalRelationship>();
    for (JoinRelationshipModel join : joins) {
        LogicalTable fromTable = new LogicalTable();
        fromTable.setName(new LocalizedString(locale, join.getLeftKeyFieldModel().getParentTable().getName()));
        LogicalTable toTable = new LogicalTable();
        toTable.setName(new LocalizedString(locale, join.getRightKeyFieldModel().getParentTable().getName()));
        LogicalColumn fromColumn = new LogicalColumn();
        fromColumn.setName(new LocalizedString(locale, join.getLeftKeyFieldModel().getName()));
        LogicalColumn toColumn = new LogicalColumn();
        toColumn.setName(new LocalizedString(locale, join.getRightKeyFieldModel().getName()));
        LogicalRelationship logicalRelationship = new LogicalRelationship();
        logicalRelationship.setFromTable(fromTable);
        logicalRelationship.setToTable(toTable);
        logicalRelationship.setFromColumn(fromColumn);
        logicalRelationship.setToColumn(toColumn);
        logicalRelationships.add(logicalRelationship);
    }
    return logicalRelationships;
}
Also used : LogicalColumn(org.pentaho.metadata.model.LogicalColumn) ArrayList(java.util.ArrayList) JoinRelationshipModel(org.pentaho.agilebi.modeler.models.JoinRelationshipModel) LocalizedString(org.pentaho.metadata.model.concept.types.LocalizedString) LogicalTable(org.pentaho.metadata.model.LogicalTable) LocalizedString(org.pentaho.metadata.model.concept.types.LocalizedString) LogicalRelationship(org.pentaho.metadata.model.LogicalRelationship)

Aggregations

JoinRelationshipModel (org.pentaho.agilebi.modeler.models.JoinRelationshipModel)7 ArrayList (java.util.ArrayList)4 JoinTableModel (org.pentaho.agilebi.modeler.models.JoinTableModel)4 JoinFieldModel (org.pentaho.agilebi.modeler.models.JoinFieldModel)2 SchemaModel (org.pentaho.agilebi.modeler.models.SchemaModel)2 HashSet (java.util.HashSet)1 LogicalColumn (org.pentaho.metadata.model.LogicalColumn)1 LogicalRelationship (org.pentaho.metadata.model.LogicalRelationship)1 LogicalTable (org.pentaho.metadata.model.LogicalTable)1 LocalizedString (org.pentaho.metadata.model.concept.types.LocalizedString)1 Bindable (org.pentaho.ui.xul.stereotype.Bindable)1