Loading null values ​​with CsvDataFileLoader in dbunit

We use CsvDataFileLoaderto load into our reference data as follows:

new InsertIdentityOperation(DatabaseOperation.CLEAN_INSERT)
            .execute(connection,
                    new CsvDataFileLoader().load("/sql/ReferenceData/"));

In any case, to put the values nullin csv, which is loaded into our db.

I do not think that there are, I would suggest that , nulland nullwill be interpreted as their string values.

Could anyone do this or know about this problem?

+3
source share
1 answer

CsvDataFileLoaderuses CsvURLProducerto load and analyze data.

In this class, on line 145 for dbunit 2.4.8, you will see the following:

if (CsvDataSetWriter.NULL.equals(row[col])) {
    row[col] = null;
}

CsvDataSetWriter.NULL "null", , null , , CSV.

, , "null" , , .

+3

All Articles