use of org.dbflute.logic.replaceschema.loaddata.base.secretary.DfColumnBindTypeProvider in project dbflute-core by dbflute.
the class DfDelimiterDataWriterImpl method createSqlBuilder.
protected DfDelimiterDataWriteSqlBuilder createSqlBuilder(DfDelimiterDataResultInfo resultInfo, String tableDbName, final Map<String, DfColumnMeta> columnMetaMap, List<String> columnNameList, List<String> valueList) {
final DfDelimiterDataWriteSqlBuilder sqlBuilder = new DfDelimiterDataWriteSqlBuilder();
sqlBuilder.setTableDbName(tableDbName);
sqlBuilder.setColumnMetaMap(columnMetaMap);
sqlBuilder.setColumnNameList(columnNameList);
sqlBuilder.setValueList(valueList);
sqlBuilder.setNotFoundColumnMap(resultInfo.getNotFoundColumnMap());
sqlBuilder.setConvertValueMap(_convertValueMap);
sqlBuilder.setDefaultValueMap(_defaultValueMap);
sqlBuilder.setBindTypeProvider(new DfColumnBindTypeProvider() {
public Class<?> provide(String tableName, DfColumnMeta columnMeta) {
return getBindType(tableName, columnMeta);
}
});
sqlBuilder.setDefaultValueProp(_defaultValueProp);
return sqlBuilder;
}
use of org.dbflute.logic.replaceschema.loaddata.base.secretary.DfColumnBindTypeProvider in project dbflute-core by dbflute.
the class DfXlsDataHandlingWriter method convertColumnValueIfNeeds.
// ===================================================================================
// Column Value Filter
// ===================
protected void convertColumnValueIfNeeds(String dataDirectory, String tableName, Map<String, Object> columnValueMap, Map<String, DfColumnMeta> columnMetaMap) {
// handling both convertValueMap and defaultValueMap
final Map<String, Map<String, String>> convertValueMap = getConvertValueMap(dataDirectory);
final Map<String, String> defaultValueMap = getDefaultValueMap(dataDirectory);
// so it does not need to convert here
if (// no convert
(convertValueMap == null || convertValueMap.isEmpty()) && (defaultValueMap == null || defaultValueMap.isEmpty())) {
// and no default
return;
}
final DfColumnBindTypeProvider bindTypeProvider = new DfColumnBindTypeProvider() {
public Class<?> provide(String tableName, DfColumnMeta columnMeta) {
return getBindType(tableName, columnMeta);
}
};
final DfColumnValueConverter converter = new DfColumnValueConverter(convertValueMap, defaultValueMap, bindTypeProvider);
converter.convert(tableName, columnValueMap, columnMetaMap);
}
Aggregations