| Constructor and Description |
|---|
CSVFilesProcessor(Database db)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
CSVTable |
addTable(String tablename,
File file)
Convenience method.
|
CSVTable |
addTable(Table<?> tab,
File file)
Add a table to this processor.
|
void |
process(boolean writeOnFly,
boolean emptyTables,
boolean recordDetails,
boolean fieldDetails,
Writer output)
Load all the data from the files, empty the tables if necessary and then
write the new data into the tables.
|
void |
process(boolean emptyTables,
boolean recordDetails,
boolean fieldDetails,
Writer output)
With write on the fly false.
|
public CSVFilesProcessor(Database db)
db - the target databasepublic CSVTable addTable(String tablename, File file)
tablename - the name of a POEM tablefile - a CSV file, with first line containing field namespublic CSVTable addTable(Table<?> tab, File file)
tab - a POEM tablefile - a CSV file, with first line containing field namespublic void process(boolean writeOnFly,
boolean emptyTables,
boolean recordDetails,
boolean fieldDetails,
Writer output)
throws IOException,
CSVParseException,
NoPrimaryKeyInCSVTableException,
CSVWriteDownException
Write a report of the progress to the Writer.
writeOnFly - flag whether to write down to db when all files read in
if set then it is the programmers responsibility to ensure that
there are no references to yet to be created fieldsemptyTables - flag whether to remove remains from last runrecordDetails - flag passed in to table.reportfieldDetails - flag passed in to table.reportoutput - to write report toIOException - if file stuff goes wrongCSVParseException - if csv file has an errorNoPrimaryKeyInCSVTableException - not thrownCSVWriteDownException - thrown when a persistent cannot be createdpublic void process(boolean emptyTables,
boolean recordDetails,
boolean fieldDetails,
Writer output)
throws IOException,
CSVParseException,
NoPrimaryKeyInCSVTableException,
CSVWriteDownException
Load all the data from the files, empty the tables if necessary and then write the new data into the tables.
Write a report of the progress to the Writer.
emptyTables - flag whether to remove remains from last runrecordDetails - flag passed in to table.reportfieldDetails - flag passed in to table.reportoutput - to write report toIOException - if file stuff goes wrongCSVParseException - if csv file has an errorNoPrimaryKeyInCSVTableException - not thrownCSVWriteDownException - thrown when a persistent cannot be createdCopyright © 2000–2021 PanEris. All rights reserved.