Search in sources :

Example 11 with ExternalDbMapData

use of org.talend.designer.dbmap.external.data.ExternalDbMapData in project tdi-studio-se by Talend.

the class ExternalDataConverter method prepareExternalData.

/**
     * 
     * Prepare ExternalMapperData object from internal data.
     * 
     * @param mapperModel
     * @return
     */
public ExternalDbMapData prepareExternalData(MapperModel mapperModel, ExternalDbMapUiProperties uiProperties) {
    ExternalDbMapData externalData = new ExternalDbMapData();
    inputTables = new ArrayList<ExternalDbMapTable>();
    externalData.setInputTables(inputTables);
    outputTables = new ArrayList<ExternalDbMapTable>();
    externalData.setOutputTables(outputTables);
    varsTables = new ArrayList<ExternalDbMapTable>();
    externalData.setVarsTables(varsTables);
    loadInExternalData(mapperModel.getInputDataMapTables());
    loadInExternalData(mapperModel.getOutputDataMapTables());
    externalData.setUiProperties(uiProperties);
    return externalData;
}
Also used : ExternalDbMapData(org.talend.designer.dbmap.external.data.ExternalDbMapData) ExternalDbMapTable(org.talend.designer.dbmap.external.data.ExternalDbMapTable)

Example 12 with ExternalDbMapData

use of org.talend.designer.dbmap.external.data.ExternalDbMapData in project tdi-studio-se by Talend.

the class DbMapComponent method getExternalEmfData.

@Override
public AbstractExternalData getExternalEmfData() {
    final DBMapData emfMapperData = DbmapFactory.eINSTANCE.createDBMapData();
    if (mapperMain == null) {
        initMapperMain(false);
    }
    mapperMain.createModelFromExternalData(getIncomingConnections(), getOutgoingConnections(), externalData, getMetadataList(), false);
    ExternalDbMapData data = mapperMain.buildExternalData();
    if (mapperMain != null && data != null) {
        if (externalData != null) {
            DBMapHelper.saveDataToEmf(emfMapperData, externalData);
        }
    }
    return emfMapperData;
}
Also used : DBMapData(org.talend.designer.dbmap.model.emf.dbmap.DBMapData) ExternalDbMapData(org.talend.designer.dbmap.external.data.ExternalDbMapData)

Aggregations

ExternalDbMapData (org.talend.designer.dbmap.external.data.ExternalDbMapData)12 ExternalDbMapTable (org.talend.designer.dbmap.external.data.ExternalDbMapTable)9 ArrayList (java.util.ArrayList)6 IConnection (org.talend.core.model.process.IConnection)6 ExternalDbMapEntry (org.talend.designer.dbmap.external.data.ExternalDbMapEntry)6 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)5 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)4 HashMap (java.util.HashMap)3 List (java.util.List)3 DBMapData (org.talend.designer.dbmap.model.emf.dbmap.DBMapData)3 IJoinType (org.talend.designer.dbmap.language.IJoinType)2 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 MarshalException (org.exolab.castor.xml.MarshalException)1 Unmarshaller (org.exolab.castor.xml.Unmarshaller)1 ValidationException (org.exolab.castor.xml.ValidationException)1 Before (org.junit.Before)1