Search in sources :

Example 1 with DfXlsDataHandlingWriter

use of org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter in project dbflute-core by dbflute.

the class DfLoadDataProcess method createXlsDataHandlerImpl.

protected DfXlsDataHandlingWriter createXlsDataHandlerImpl() {
    if (_xlsDataHandlerImpl != null) {
        return _xlsDataHandlerImpl;
    }
    final DfXlsDataHandlingWriter handler = new DfXlsDataHandlingWriter(_dataSource, _mainSchema);
    handler.acceptSkipSheet(getReplaceSchemaProperties().getSkipSheet());
    handler.setLoggingInsertSql(isLoggingInsertSql());
    handler.setSuppressBatchUpdate(isSuppressBatchUpdate());
    handler.setSuppressCheckColumnDef(isSuppressCheckColumnDef());
    handler.setSuppressCheckImplicitSet(isSuppressCheckImplicitSet());
    handler.setDataWritingInterceptor(getDataWritingInterceptor());
    handler.setConvertValueProp(_convertValueProp);
    handler.setDefaultValueProp(_defaultValueProp);
    handler.setLoadingControlProp(_loadingControlProp);
    _xlsDataHandlerImpl = handler;
    return _xlsDataHandlerImpl;
}
Also used : DfXlsDataHandlingWriter(org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter)

Example 2 with DfXlsDataHandlingWriter

use of org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter in project dbflute-core by dbflute.

the class DfAbstractDataWriterTest method test_isNotNullNotString.

// ===================================================================================
// Process per Type
// ================
// -----------------------------------------------------
// NotNull NotString
// -----------------
public void test_isNotNullNotString() {
    // via XlsData
    // ## Arrange ##
    final DfXlsDataHandlingWriter impl = new DfXlsDataHandlingWriter(null, null);
    // ## Act & Assert ##
    assertFalse(impl.isNotNullNotString(null));
    assertFalse(impl.isNotNullNotString("abc"));
    assertTrue(impl.isNotNullNotString(new Date()));
    assertTrue(impl.isNotNullNotString(new Timestamp(System.currentTimeMillis())));
}
Also used : Timestamp(java.sql.Timestamp) DfXlsDataHandlingWriter(org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter) Date(java.util.Date)

Example 3 with DfXlsDataHandlingWriter

use of org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter in project dbflute-core by dbflute.

the class DfAbstractDataWriterTest method test_processBoolean.

// -----------------------------------------------------
// Boolean
// -------
public void test_processBoolean() throws Exception {
    // via XlsData
    // ## Arrange ##
    final DfXlsDataHandlingWriter impl = new DfXlsDataHandlingWriter(null, null) {

        @Override
        protected Class<?> getBindType(String tableName, DfColumnMeta columnMetaInfo) {
            return BigDecimal.class;
        }
    };
    Map<String, DfColumnMeta> columnMetaInfoMap = StringKeyMap.createAsCaseInsensitive();
    DfColumnMeta info = new DfColumnMeta();
    info.setColumnName("foo");
    info.setColumnSize(3);
    info.setJdbcDefValue(Types.NUMERIC);
    columnMetaInfoMap.put("foo", info);
    // ## Act ##
    boolean actual = impl.processBoolean("tbl", "foo", "0", null, null, 0, columnMetaInfoMap, 3);
    // ## Assert ##
    log("actual=" + actual);
    assertFalse(actual);
}
Also used : DfColumnMeta(org.dbflute.logic.jdbc.metadata.info.DfColumnMeta) DfXlsDataHandlingWriter(org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter) BigDecimal(java.math.BigDecimal)

Aggregations

DfXlsDataHandlingWriter (org.dbflute.logic.replaceschema.loaddata.xls.DfXlsDataHandlingWriter)3 BigDecimal (java.math.BigDecimal)1 Timestamp (java.sql.Timestamp)1 Date (java.util.Date)1 DfColumnMeta (org.dbflute.logic.jdbc.metadata.info.DfColumnMeta)1