use of org.dbflute.s2dao.valuetype.basic.StringType in project dbflute-core by dbflute.
the class DfLReverseDataExtractor method createColumnValueTypeMap.
// ===================================================================================
// JDBC Handling
// =============
protected Map<String, ValueType> createColumnValueTypeMap(List<Column> columnList) {
final Map<String, ValueType> valueTypeMap = new LinkedHashMap<String, ValueType>();
for (Column column : columnList) {
final String columnName = column.getName();
// create value type for the column
final ValueType valueType;
if (column.isJavaNativeStringObject()) {
if (column.isDbTypeStringClob()) {
valueType = new StringClobType();
} else {
valueType = new StringType();
}
} else if (column.isJavaNativeDateObject()) {
// date types should be treated correctly
if (column.isJdbcTypeTime()) {
valueType = new TimeType();
} else if (column.isJdbcTypeTimestamp()) {
valueType = new TimestampType();
} else if (column.isJdbcTypeDate()) {
if (column.isDbTypeOracleDate()) {
valueType = new UtilDateAsTimestampType();
} else {
valueType = new UtilDateAsSqlDateType();
}
} else {
// no way
valueType = new TimestampType();
}
} else if (column.isJavaNativeBinaryObject()) {
// unsupported BLOG as loda data
valueType = new NullBytesType();
} else {
// other types are treated as string
// because ReplaceSchema can accept them
valueType = new StringType();
}
valueTypeMap.put(columnName, valueType);
}
return valueTypeMap;
}
use of org.dbflute.s2dao.valuetype.basic.StringType in project dbflute-core by dbflute.
the class DfLReverseDataExtractor method createColumnValueTypeMap.
protected Map<String, ValueType> createColumnValueTypeMap(List<Column> columnList) {
final Map<String, ValueType> valueTypeMap = new LinkedHashMap<String, ValueType>();
for (Column column : columnList) {
final String columnName = column.getName();
// create value type for the column
final ValueType valueType;
if (column.isJavaNativeStringObject()) {
if (column.isDbTypeStringClob()) {
valueType = new StringClobType();
} else {
valueType = new StringType();
}
} else if (column.isJavaNativeDateObject()) {
// date types should be treated correctly
if (column.isJdbcTypeTime()) {
valueType = new TimeType();
} else if (column.isJdbcTypeTimestamp()) {
valueType = new TimestampType();
} else if (column.isJdbcTypeDate()) {
if (column.isDbTypeOracleDate()) {
valueType = new UtilDateAsTimestampType();
} else {
valueType = new UtilDateAsSqlDateType();
}
} else {
// no way
valueType = new TimestampType();
}
} else if (column.isJavaNativeBinaryObject()) {
// unsupported BLOG as load data
valueType = new NullBytesType();
} else {
// other types are treated as string
// because ReplaceSchema can accept them
valueType = new StringType();
}
valueTypeMap.put(columnName, valueType);
}
return valueTypeMap;
}
Aggregations