Search in sources :

Example 1 with JDBCOutputUpdateOrInsertWriter

use of org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateOrInsertWriter in project components by Talend.

the class JDBCOutputWriteOperation method createWriter.

@Override
public Writer<Result> createWriter(RuntimeContainer runtimeContainer) {
    RuntimeSettingProvider properties = ((JDBCSink) this.getSink()).properties;
    DataAction dataAction = properties.getRuntimeSetting().getDataAction();
    switch(dataAction) {
        case INSERT:
            return new JDBCOutputInsertWriter(this, runtimeContainer);
        case UPDATE:
            return new JDBCOutputUpdateWriter(this, runtimeContainer);
        case DELETE:
            return new JDBCOutputDeleteWriter(this, runtimeContainer);
        case INSERT_OR_UPDATE:
            return new JDBCOutputInsertOrUpdateWriter(this, runtimeContainer);
        case UPDATE_OR_INSERT:
            return new JDBCOutputUpdateOrInsertWriter(this, runtimeContainer);
        default:
            return null;
    }
}
Also used : JDBCOutputUpdateWriter(org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateWriter) DataAction(org.talend.components.jdbc.tjdbcoutput.TJDBCOutputProperties.DataAction) JDBCOutputInsertOrUpdateWriter(org.talend.components.jdbc.runtime.writer.JDBCOutputInsertOrUpdateWriter) JDBCOutputInsertWriter(org.talend.components.jdbc.runtime.writer.JDBCOutputInsertWriter) RuntimeSettingProvider(org.talend.components.jdbc.RuntimeSettingProvider) JDBCOutputDeleteWriter(org.talend.components.jdbc.runtime.writer.JDBCOutputDeleteWriter) JDBCOutputUpdateOrInsertWriter(org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateOrInsertWriter)

Aggregations

RuntimeSettingProvider (org.talend.components.jdbc.RuntimeSettingProvider)1 JDBCOutputDeleteWriter (org.talend.components.jdbc.runtime.writer.JDBCOutputDeleteWriter)1 JDBCOutputInsertOrUpdateWriter (org.talend.components.jdbc.runtime.writer.JDBCOutputInsertOrUpdateWriter)1 JDBCOutputInsertWriter (org.talend.components.jdbc.runtime.writer.JDBCOutputInsertWriter)1 JDBCOutputUpdateOrInsertWriter (org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateOrInsertWriter)1 JDBCOutputUpdateWriter (org.talend.components.jdbc.runtime.writer.JDBCOutputUpdateWriter)1 DataAction (org.talend.components.jdbc.tjdbcoutput.TJDBCOutputProperties.DataAction)1