use of org.dbflute.exception.DfDelimiterDataRegistrationFailureException in project dbflute-core by dbflute.
the class DfDelimiterDataWriteSqlBuilder method createBasicColumnValueMap.
// ===================================================================================
// SQL Parts
// =========
protected Map<String, String> createBasicColumnValueMap() {
if (_basicColumnValueMap != null) {
return _basicColumnValueMap;
}
_basicColumnValueMap = new LinkedHashMap<String, String>();
int columnCount = -1;
for (String columnName : _columnNameList) {
columnCount++;
if (!_columnMetaMap.isEmpty() && !_columnMetaMap.containsKey(columnName)) {
// changed logic at setupColumnNameList() in writer like this:
// "added columns for default value are existing in DB"
// by jflute (2017/03/26)
// if (hasDefaultValue(columnName)) {
// continue;
// }
handleNotFoundColumn(columnName);
continue;
}
final String value;
try {
value = columnCount < _valueList.size() ? _valueList.get(columnCount) : null;
} catch (RuntimeException e) {
String msg = buildDelimiterDataRegistrationFailureMessage(columnCount);
throw new DfDelimiterDataRegistrationFailureException(msg, e);
}
if (!_columnMetaMap.isEmpty() && _columnMetaMap.containsKey(columnName)) {
String realDbName = _columnMetaMap.get(columnName).getColumnName();
_basicColumnValueMap.put(realDbName, value);
} else {
_basicColumnValueMap.put(columnName, value);
}
}
return _basicColumnValueMap;
}
Aggregations