Package org.nuiton.topia.service.csv.in
Interface ImportStrategy<T extends TopiaEntityEnum>
public interface ImportStrategy<T extends TopiaEntityEnum>
Strategy to import some stuff.
Implements it and then you can use it with helper methods
TopiaCsvImports.importTable(Reader, ImportStrategy, TableMeta, CsvImportResult),
TopiaCsvImports.importAssociation(Reader, ImportStrategy, AssociationMeta, CsvImportResult).- Since:
- 2.6.12
- Author:
- Tony Chemit - chemit@codelutin.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidimportAssociation(AssociationMeta<T> meta, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult) Import a association given aimporterwith an optional csv result.<E extends TopiaEntity>
voidimportTable(TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) Import a table given aimporterwith an optional csv result.<E extends TopiaEntity>
Iterable<E>importTableAndReturnThem(TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) Import a table given aimporterwith an optional csv result, and return them.
-
Method Details
-
getModelFactory
ImportModelFactory<T> getModelFactory()- Returns:
- the model factory (will be used to produce the model to import).
-
importTable
<E extends TopiaEntity> void importTable(TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) throws TopiaException Import a table given aimporterwith an optional csv result.- Parameters:
meta- type of table to importimporter- the csv importercsvResult- optional object where to put csv import result- Throws:
TopiaException- if any db problem
-
importTableAndReturnThem
<E extends TopiaEntity> Iterable<E> importTableAndReturnThem(TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) throws TopiaException Import a table given aimporterwith an optional csv result, and return them.- Parameters:
meta- type of table to importimporter- the csv importercsvResult- optional object where to put csv import result- Returns:
- imported entities
- Throws:
TopiaException- if any db problem- Since:
- 2.6.14
-
importAssociation
void importAssociation(AssociationMeta<T> meta, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult) throws TopiaException Import a association given aimporterwith an optional csv result.- Parameters:
meta- type of association to importimporter- the csv importercsvResult- optional object where to put csv import result- Throws:
TopiaException- if any db problem
-