Search in sources :

Example 6 with InputTable

use of org.talend.designer.mapper.model.emf.mapper.InputTable in project tdi-studio-se by Talend.

the class MapperDataImplTest method test2.

private void test2() {
    MapperDataImpl mapData1 = new MapperDataImpl();
    MapperDataImpl mapData2 = new MapperDataImpl();
    assertTrue(mapData1.equals(mapData2));
    final InputTable persistentTable = MapperFactory.eINSTANCE.createInputTable();
    persistentTable.setActivateCondensedTool(true);
    persistentTable.setActivateExpressionFilter(true);
    persistentTable.setActivateColumnNameFilter(true);
    persistentTable.setExpressionFilter("expressionFilter1");
    persistentTable.setMinimized(false);
    persistentTable.setName("tableName");
    persistentTable.setSizeState(SizeState.MAXIMIZED);
    persistentTable.setLookupMode("LookupMode");
    persistentTable.setMatchingMode("MatchingMode");
    persistentTable.setInnerJoin(true);
    persistentTable.setPersistent(false);
    persistentTable.setId("id1");
    final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry.setExpression("expression1");
    emfMapperTableEntry.setName("entityName");
    emfMapperTableEntry.setNullable(false);
    emfMapperTableEntry.setType("type1");
    emfMapperTableEntry.setOperator("operator1");
    persistentTable.getMapperTableEntries().add(emfMapperTableEntry);
    final MapperTableEntry mapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
    mapperTableEntry.setExpression("expression1");
    mapperTableEntry.setName("entityName");
    mapperTableEntry.setNullable(true);
    mapperTableEntry.setType("type1");
    mapperTableEntry.setOperator("operator1");
    persistentTable.getGlobalMapKeysValues().add(emfMapperTableEntry);
    mapData1.getInputTables().add(persistentTable);
    final InputTable persistentTable2 = MapperFactory.eINSTANCE.createInputTable();
    persistentTable2.setActivateCondensedTool(true);
    persistentTable2.setActivateExpressionFilter(true);
    persistentTable2.setActivateColumnNameFilter(true);
    persistentTable2.setExpressionFilter("exprefssionFilter1");
    persistentTable2.setMinimized(false);
    persistentTable2.setName("tableName");
    persistentTable2.setSizeState(SizeState.MAXIMIZED);
    persistentTable2.setLookupMode("LookupMode");
    persistentTable2.setMatchingMode("MatchiggngMode");
    persistentTable2.setInnerJoin(true);
    persistentTable2.setPersistent(false);
    persistentTable2.setId("id1");
    final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry2.setExpression("expression1");
    emfMapperTableEntry2.setName("entityName");
    emfMapperTableEntry2.setNullable(false);
    emfMapperTableEntry2.setType("type1");
    emfMapperTableEntry2.setOperator("operat");
    persistentTable.getMapperTableEntries().add(emfMapperTableEntry2);
    final MapperTableEntry mapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
    mapperTableEntry2.setExpression("expression1");
    mapperTableEntry2.setName("entityName");
    mapperTableEntry2.setNullable(true);
    mapperTableEntry2.setType("typge1");
    mapperTableEntry2.setOperator("opgerator1");
    persistentTable.getGlobalMapKeysValues().add(emfMapperTableEntry2);
    mapData2.getInputTables().add(persistentTable2);
    assertFalse(mapData1.equals(mapData2));
}
Also used : InputTable(org.talend.designer.mapper.model.emf.mapper.InputTable) MapperTableEntry(org.talend.designer.mapper.model.emf.mapper.MapperTableEntry)

Example 7 with InputTable

use of org.talend.designer.mapper.model.emf.mapper.InputTable in project tdi-studio-se by Talend.

the class MapperDataImpl method equals.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated not
     */
@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    MapperDataImpl dbObj = (MapperDataImpl) obj;
    EList<InputTable> inputs = dbObj.getInputTables();
    EList<OutputTable> outputs = dbObj.getOutputTables();
    EList<VarTable> vars = dbObj.getVarTables();
    if (inputs.size() != getInputTables().size()) {
        return false;
    }
    if (outputs.size() != getOutputTables().size()) {
        return false;
    }
    if (vars.size() != getVarTables().size()) {
        return false;
    }
    for (InputTable inputTable : inputTables) {
        boolean found = false;
        for (InputTable input : inputs) {
            if (inputTable.getName().equals(input.getName())) {
                found = true;
                if (!inputTable.equals(input)) {
                    return false;
                }
                break;
            }
        }
        if (found == false) {
            return false;
        }
    }
    for (OutputTable outputTable : outputTables) {
        boolean found = false;
        for (OutputTable output : outputs) {
            if (outputTable.getName().equals(output.getName())) {
                found = true;
                if (!outputTable.equals(output)) {
                    return false;
                }
                break;
            }
        }
        if (found == false) {
            return false;
        }
    }
    for (VarTable varTable : varTables) {
        boolean found = false;
        for (VarTable var : vars) {
            if (varTable.getName().equals(var.getName())) {
                found = true;
                if (!varTable.equals(var)) {
                    return false;
                }
                break;
            }
        }
        if (found == false) {
            return false;
        }
    }
    return true;
}
Also used : VarTable(org.talend.designer.mapper.model.emf.mapper.VarTable) InputTable(org.talend.designer.mapper.model.emf.mapper.InputTable) OutputTable(org.talend.designer.mapper.model.emf.mapper.OutputTable)

Aggregations

InputTable (org.talend.designer.mapper.model.emf.mapper.InputTable)7 OutputTable (org.talend.designer.mapper.model.emf.mapper.OutputTable)5 ExternalMapperData (org.talend.designer.mapper.external.data.ExternalMapperData)3 MapperData (org.talend.designer.mapper.model.emf.mapper.MapperData)3 MapperTableEntry (org.talend.designer.mapper.model.emf.mapper.MapperTableEntry)3 VarTable (org.talend.designer.mapper.model.emf.mapper.VarTable)3 ArrayList (java.util.ArrayList)2 ExternalMapperTable (org.talend.designer.mapper.external.data.ExternalMapperTable)2 UiProperties (org.talend.designer.mapper.model.emf.mapper.UiProperties)2 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)1 ExternalMapperTableEntry (org.talend.designer.mapper.external.data.ExternalMapperTableEntry)1 ExternalMapperUiProperties (org.talend.designer.mapper.external.data.ExternalMapperUiProperties)1