use of org.talend.designer.mapper.external.data.ExternalMapperTableEntry in project tdi-studio-se by Talend.
the class AbstractInOutTable method initFromExternalData.
@Override
protected void initFromExternalData(ExternalMapperTable externalMapperTable) {
super.initFromExternalData(externalMapperTable);
expressionFilterEntry = new ExpressionFilterEntry(this);
tableMapSettingEntriesModel = new ExtendedTableModel<GlobalMapEntry>("Model for map setting", mapSettingEntries);
if (externalMapperTable != null) {
this.expressionFilterEntry.setExpression(externalMapperTable.getExpressionFilter());
this.activateExpressionFilter = externalMapperTable.isActivateExpressionFilter();
this.activateCondensedTool = externalMapperTable.isActivateCondensedTool();
this.activateColumnNameFilter = externalMapperTable.isActivateColumnNameFilter();
this.id = externalMapperTable.getId();
this.isRepository = this.id == null ? false : true;
}
List<IMetadataColumn> columns = new ArrayList<IMetadataColumn>();
Map<String, ExternalMapperTableEntry> nameToPerTabEntry = new HashMap<String, ExternalMapperTableEntry>();
if (externalMapperTable != null && externalMapperTable.getMetadataTableEntries() != null) {
for (ExternalMapperTableEntry perTableEntry : externalMapperTable.getMetadataTableEntries()) {
nameToPerTabEntry.put(perTableEntry.getName(), perTableEntry);
}
}
String originalTableName = null;
if (metadataTable != null) {
originalTableName = metadataTable.getTableName();
}
if (isRepository) {
IMetadataTable table = MetadataToolHelper.getMetadataFromRepository(id);
if (table == null) {
this.id = null;
this.isRepository = false;
} else {
this.metadataTable = table;
this.metadataTable.setTableName(originalTableName);
}
}
if (metadataTable != null) {
columns = this.metadataTable.getListColumns();
}
updateTableEntries(columns, nameToPerTabEntry);
}
use of org.talend.designer.mapper.external.data.ExternalMapperTableEntry in project tdi-studio-se by Talend.
the class InputTable method initFromExternalData.
/*
* (non-Javadoc)
*
* @see
* org.talend.designer.mapper.model.table.AbstractInOutTable#initFromExternalData(org.talend.designer.mapper.external
* .data.ExternalMapperTable)
*/
@Override
public void initFromExternalData(ExternalMapperTable externalMapperTable) {
super.initFromExternalData(externalMapperTable);
if (externalMapperTable != null) {
this.innerJoin = externalMapperTable.isInnerJoin();
this.persistent = externalMapperTable.isPersistent();
this.matchingMode = TMAP_MATCHING_MODE.parse(externalMapperTable.getMatchingMode());
if (matchingMode == null) {
if (mapperManager.isTableHasAtLeastOneHashKey(this)) {
matchingMode = mapperManager.isMRProcess() ? TMAP_MATCHING_MODE.ALL_MATCHES : TMAP_MATCHING_MODE.UNIQUE_MATCH;
} else {
matchingMode = TMAP_MATCHING_MODE.ALL_ROWS;
}
}
if (matchingMode == TMAP_MATCHING_MODE.LAST_MATCH) {
matchingMode = mapperManager.isMRProcess() ? TMAP_MATCHING_MODE.ALL_MATCHES : TMAP_MATCHING_MODE.UNIQUE_MATCH;
;
}
this.lookupMode = TMAP_LOOKUP_MODE.parse(externalMapperTable.getLookupMode());
if (lookupMode == null) {
lookupMode = TMAP_LOOKUP_MODE.LOAD_ONCE;
}
List<ExternalMapperTableEntry> globalMapEntries = externalMapperTable.getGlobalMapKeysValues();
if (globalMapEntries != null) {
for (ExternalMapperTableEntry externalMapperTableEntry : globalMapEntries) {
GlobalMapEntry entry = new GlobalMapEntry(this, externalMapperTableEntry.getName(), // , externalMapperTableEntry.getType());
externalMapperTableEntry.getExpression());
// if (LanguageManager.getCurrentLanguage() == ECodeLanguage.JAVA) {
// varTableEntry.setNullable(externalMapperTableEntry.isNullable());
// }
addGlobalMapEntry(entry);
}
}
}
}
Aggregations