Search in sources :

Example 1 with DfLoadedFile

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

the class DfLoadDataProcess method createFinalInfo.

// ===================================================================================
// Final Info
// ==========
protected DfLoadDataFinalInfo createFinalInfo(RuntimeException loadEx) {
    final DfLoadDataFinalInfo finalInfo = new DfLoadDataFinalInfo();
    final List<DfLoadedFile> loadedFileList = _loadedDataInfo.getLoadedFileList();
    final int loadedFileCount = loadedFileList.size();
    final String title = "{Load Data}";
    final String resultMessage = title + ": loaded-files=" + loadedFileCount;
    final boolean failure;
    final List<String> detailMessageList = new ArrayList<String>();
    if (_success) {
        failure = false;
        if (loadedFileCount > 0) {
            // has the last line separator
            setupDetailMessage(detailMessageList);
        } else {
            detailMessageList.add("- (no data file)");
        }
    } else {
        // it is the precondition that LoadData stops at the first failure
        failure = true;
        if (loadedFileCount > 0) {
            // has the last line separator
            setupDetailMessage(detailMessageList);
        }
        detailMessageList.add("x (failed: Look at the exception message)");
    }
    finalInfo.setResultMessage(resultMessage);
    for (String detailMessage : detailMessageList) {
        finalInfo.addDetailMessage(detailMessage);
    }
    finalInfo.setFailure(failure);
    finalInfo.setLoadEx(loadEx);
    return finalInfo;
}
Also used : DfLoadDataFinalInfo(org.dbflute.logic.replaceschema.finalinfo.DfLoadDataFinalInfo) DfLoadedFile(org.dbflute.logic.replaceschema.loaddata.DfLoadedFile) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 DfLoadDataFinalInfo (org.dbflute.logic.replaceschema.finalinfo.DfLoadDataFinalInfo)1 DfLoadedFile (org.dbflute.logic.replaceschema.loaddata.DfLoadedFile)1