Search in sources :

Example 6 with MapperTableEntry

use of org.talend.designer.mapper.model.emf.mapper.MapperTableEntry 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 MapperTableEntry

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

the class MapperDataImplTest method test4.

private void test4() {
    MapperDataImpl mapData1 = new MapperDataImpl();
    MapperDataImpl mapData2 = new MapperDataImpl();
    assertTrue(mapData1.equals(mapData2));
    final OutputTable persistentTable = MapperFactory.eINSTANCE.createOutputTable();
    persistentTable.setActivateCondensedTool(true);
    persistentTable.setActivateExpressionFilter(true);
    persistentTable.setActivateColumnNameFilter(true);
    persistentTable.setExpressionFilter("expressionFilter1");
    persistentTable.setMinimized(false);
    persistentTable.setName("tableName");
    persistentTable.setSizeState(SizeState.MAXIMIZED);
    persistentTable.setId("id1");
    persistentTable.setReject(true);
    persistentTable.setRejectInnerJoin(false);
    persistentTable.setIsErrorRejectTable(false);
    persistentTable.setIsJoinTableOf("join");
    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);
    mapData1.getOutputTables().add(persistentTable);
    final OutputTable persistentTable2 = MapperFactory.eINSTANCE.createOutputTable();
    persistentTable2.setActivateCondensedTool(true);
    persistentTable2.setActivateExpressionFilter(true);
    persistentTable2.setActivateColumnNameFilter(true);
    persistentTable2.setExpressionFilter("expressionhhFilter1");
    persistentTable2.setMinimized(false);
    persistentTable2.setName("tablebbName");
    persistentTable2.setSizeState(SizeState.MAXIMIZED);
    persistentTable2.setId("id2");
    persistentTable2.setReject(true);
    persistentTable2.setRejectInnerJoin(false);
    persistentTable2.setIsErrorRejectTable(false);
    persistentTable2.setIsJoinTableOf("jonnin");
    final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry2.setExpression("expggression1");
    emfMapperTableEntry2.setName("entityName");
    emfMapperTableEntry2.setNullable(false);
    emfMapperTableEntry2.setType("tyggpe1");
    emfMapperTableEntry2.setOperator("opeggrator1");
    persistentTable2.getMapperTableEntries().add(emfMapperTableEntry2);
    mapData2.getOutputTables().add(persistentTable2);
    assertFalse(mapData1.equals(mapData2));
}
Also used : MapperTableEntry(org.talend.designer.mapper.model.emf.mapper.MapperTableEntry) OutputTable(org.talend.designer.mapper.model.emf.mapper.OutputTable)

Example 8 with MapperTableEntry

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

the class MapperDataImplTest method test3.

private void test3() {
    MapperDataImpl mapData1 = new MapperDataImpl();
    MapperDataImpl mapData2 = new MapperDataImpl();
    assertTrue(mapData1.equals(mapData2));
    final OutputTable persistentTable = MapperFactory.eINSTANCE.createOutputTable();
    persistentTable.setActivateCondensedTool(true);
    persistentTable.setActivateExpressionFilter(true);
    persistentTable.setActivateColumnNameFilter(true);
    persistentTable.setExpressionFilter("expressionFilter1");
    persistentTable.setMinimized(false);
    persistentTable.setName("tableName");
    persistentTable.setSizeState(SizeState.MAXIMIZED);
    persistentTable.setId("id1");
    persistentTable.setReject(true);
    persistentTable.setRejectInnerJoin(false);
    persistentTable.setIsErrorRejectTable(false);
    persistentTable.setIsJoinTableOf("join");
    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);
    mapData1.getOutputTables().add(persistentTable);
    final OutputTable persistentTable2 = MapperFactory.eINSTANCE.createOutputTable();
    persistentTable2.setActivateCondensedTool(true);
    persistentTable2.setActivateExpressionFilter(true);
    persistentTable2.setActivateColumnNameFilter(true);
    persistentTable2.setExpressionFilter("expressionFilter1");
    persistentTable2.setMinimized(false);
    persistentTable2.setName("tableName");
    persistentTable2.setSizeState(SizeState.MAXIMIZED);
    persistentTable2.setId("id1");
    persistentTable2.setReject(true);
    persistentTable2.setRejectInnerJoin(false);
    persistentTable2.setIsErrorRejectTable(false);
    persistentTable2.setIsJoinTableOf("join");
    final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry2.setExpression("expression1");
    emfMapperTableEntry2.setName("entityName");
    emfMapperTableEntry2.setNullable(false);
    emfMapperTableEntry2.setType("type1");
    emfMapperTableEntry2.setOperator("operator1");
    persistentTable2.getMapperTableEntries().add(emfMapperTableEntry2);
    mapData2.getOutputTables().add(persistentTable2);
    assertTrue(mapData1.equals(mapData2));
}
Also used : MapperTableEntry(org.talend.designer.mapper.model.emf.mapper.MapperTableEntry) OutputTable(org.talend.designer.mapper.model.emf.mapper.OutputTable)

Example 9 with MapperTableEntry

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

the class MapperDataImplTest method test6.

private void test6() {
    MapperDataImpl mapData1 = new MapperDataImpl();
    MapperDataImpl mapData2 = new MapperDataImpl();
    assertTrue(mapData1.equals(mapData2));
    final VarTable persistentVarTable = MapperFactory.eINSTANCE.createVarTable();
    persistentVarTable.setMinimized(false);
    persistentVarTable.setName("name1");
    persistentVarTable.setSizeState(SizeState.INTERMEDIATE);
    final MapperTableEntry emfMapperTableEntry = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry.setExpression("expression1");
    emfMapperTableEntry.setName("ss");
    emfMapperTableEntry.setNullable(true);
    emfMapperTableEntry.setType("dvvd");
    emfMapperTableEntry.setOperator("ovvo");
    persistentVarTable.getMapperTableEntries().add(emfMapperTableEntry);
    mapData1.getVarTables().add(persistentVarTable);
    final VarTable persistentVarTable2 = MapperFactory.eINSTANCE.createVarTable();
    persistentVarTable2.setMinimized(false);
    persistentVarTable2.setName("name1");
    persistentVarTable2.setSizeState(SizeState.INTERMEDIATE);
    final MapperTableEntry emfMapperTableEntry2 = MapperFactory.eINSTANCE.createMapperTableEntry();
    emfMapperTableEntry2.setExpression("expreshsion1");
    emfMapperTableEntry2.setName("ss");
    emfMapperTableEntry2.setNullable(true);
    emfMapperTableEntry2.setType("dvd");
    emfMapperTableEntry2.setOperator("oov");
    persistentVarTable2.getMapperTableEntries().add(emfMapperTableEntry2);
    mapData2.getVarTables().add(persistentVarTable2);
    assertFalse(mapData1.equals(mapData2));
}
Also used : VarTable(org.talend.designer.mapper.model.emf.mapper.VarTable) MapperTableEntry(org.talend.designer.mapper.model.emf.mapper.MapperTableEntry)

Example 10 with MapperTableEntry

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

the class InputTableImpl 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;
    }
    InputTableImpl other = (InputTableImpl) obj;
    if (this.innerJoin != other.innerJoin) {
        return false;
    }
    if (this.persistent != other.persistent) {
        return false;
    }
    if (this.lookupMode == null) {
        if (other.lookupMode != null) {
            return false;
        }
    } else if (!this.lookupMode.equals(other.lookupMode)) {
        return false;
    }
    if (this.matchingMode == null) {
        if (other.matchingMode != null) {
            return false;
        }
    } else if (!this.matchingMode.equals(other.matchingMode)) {
        return false;
    }
    EList<MapperTableEntry> otherEntries = other.getGlobalMapKeysValues();
    if (getGlobalMapKeysValues().size() != otherEntries.size()) {
        return false;
    }
    for (MapperTableEntry entry : getGlobalMapKeysValues()) {
        boolean found = false;
        for (MapperTableEntry otherEntry : otherEntries) {
            if (entry.getName().equals(otherEntry.getName())) {
                found = true;
                if (!entry.equals(otherEntry)) {
                    return false;
                }
                break;
            }
        }
        if (found == false) {
            return false;
        }
    }
    return super.equals(obj);
}
Also used : MapperTableEntry(org.talend.designer.mapper.model.emf.mapper.MapperTableEntry)

Aggregations

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