Sha256: 95adbfacfa376135ab035a977f29dcbd5ecb326c1e6712a60cf77ad1082cdc2b

Contents?: true

Size: 1.58 KB

Versions: 28

Compression:

Stored size: 1.58 KB

Contents

package org.embulk.output.sqlserver.setter;

import java.sql.Types;

import org.embulk.output.jdbc.BatchInsert;
import org.embulk.output.jdbc.JdbcColumn;
import org.embulk.output.jdbc.JdbcColumnOption;
import org.embulk.output.jdbc.setter.ColumnSetter;
import org.embulk.output.jdbc.setter.ColumnSetterFactory;
import org.joda.time.DateTimeZone;

public class SQLServerColumnSetterFactory
        extends ColumnSetterFactory
{
    public SQLServerColumnSetterFactory(BatchInsert batch, DateTimeZone defaultTimeZone)
    {
        super(batch, defaultTimeZone);
    }

    @Override
    public ColumnSetter newCoalesceColumnSetter(JdbcColumn column, JdbcColumnOption option)
    {
        switch (column.getSqlType()) {
        case Types.TINYINT:
            return new SQLServerByteColumnSetter(batch, column, newDefaultValueSetter(column, option));

        case Types.TIME:
            return new SQLServerSqlTimeColumnSetter(batch, column, newDefaultValueSetter(column, option), newCalendar(option));

        default:
            return super.newCoalesceColumnSetter(column, option);
        }
    }

    @Override
    public ColumnSetter newColumnSetter(JdbcColumn column, JdbcColumnOption option)
    {
        switch (option.getValueType()) {
        case "byte":
            return new SQLServerByteColumnSetter(batch, column, newDefaultValueSetter(column, option));

        case "time":
            return new SQLServerSqlTimeColumnSetter(batch, column, newDefaultValueSetter(column, option), newCalendar(option));

        default:
            return super.newColumnSetter(column, option);
        }
    }

}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
embulk-output-sqlserver-0.8.5 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.8.4 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.8.3 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.8.2 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.8.1 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.8.0 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.13 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.12 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.11 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.10 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.9 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.8 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.7 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.6 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.5 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.4 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.3 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.2 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.1 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java
embulk-output-sqlserver-0.7.0 src/main/java/org/embulk/output/sqlserver/setter/SQLServerColumnSetterFactory.java