Search in sources :

Example 16 with FilterTableEntry

use of org.talend.designer.dbmap.model.tableentry.FilterTableEntry in project tdi-studio-se by Talend.

the class ExternalDataConverter method fillExternalTable.

/**
     * DOC amaumont Comment method "process".
     * 
     * @param externalMapperTable
     * @param table
     */
private void fillExternalTable(OutputTable table, ExternalDbMapTable externalMapperTable) {
    externalMapperTable.setMinimized(table.isMinimized());
    externalMapperTable.setName(table.getUniqueName());
    externalMapperTable.setTableName(table.getTableName());
    /**
         * set custom where conditions entries
         */
    ArrayList<ExternalDbMapEntry> constraintTableEntries = new ArrayList<ExternalDbMapEntry>();
    for (FilterTableEntry constraintWhereTableEntry : table.getWhereFilterEntries()) {
        ExternalDbMapEntry externalMapperTableEntry = new ExternalDbMapEntry();
        externalMapperTableEntry.setExpression(constraintWhereTableEntry.getExpression());
        externalMapperTableEntry.setName(constraintWhereTableEntry.getName());
        constraintTableEntries.add(externalMapperTableEntry);
    }
    externalMapperTable.setCustomWhereConditionsEntries(constraintTableEntries);
    /**
         * set custom other conditions entries
         */
    constraintTableEntries = new ArrayList<ExternalDbMapEntry>();
    for (FilterTableEntry constraintOtherTableEntry : table.getOtherFilterEntries()) {
        ExternalDbMapEntry externalMapperTableEntry = new ExternalDbMapEntry();
        externalMapperTableEntry.setExpression(constraintOtherTableEntry.getExpression());
        externalMapperTableEntry.setName(constraintOtherTableEntry.getName());
        constraintTableEntries.add(externalMapperTableEntry);
    }
    externalMapperTable.setCustomOtherConditionsEntries(constraintTableEntries);
    outputTables.add(externalMapperTable);
}
Also used : ArrayList(java.util.ArrayList) FilterTableEntry(org.talend.designer.dbmap.model.tableentry.FilterTableEntry) ExternalDbMapEntry(org.talend.designer.dbmap.external.data.ExternalDbMapEntry)

Aggregations

FilterTableEntry (org.talend.designer.dbmap.model.tableentry.FilterTableEntry)16 IColumnEntry (org.talend.designer.abstractmap.model.tableentry.IColumnEntry)11 OutputTable (org.talend.designer.dbmap.model.table.OutputTable)8 IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)5 ITableEntry (org.talend.designer.abstractmap.model.tableentry.ITableEntry)5 DataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView)5 TableViewer (org.eclipse.jface.viewers.TableViewer)3 TableViewerCreator (org.talend.commons.ui.swt.tableviewer.TableViewerCreator)3 InputTable (org.talend.designer.dbmap.model.table.InputTable)3 HashMap (java.util.HashMap)2 AbstractExtendedTableViewer (org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer)2 TableEntryLocation (org.talend.designer.dbmap.model.tableentry.TableEntryLocation)2 InputDataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.InputDataMapTableView)2 OutputDataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView)2 ArrayList (java.util.ArrayList)1 ICellEditorListener (org.eclipse.jface.viewers.ICellEditorListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)1 ControlEvent (org.eclipse.swt.events.ControlEvent)1