public class TopiaCsvImports extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
INSERT_ASSOCIATION |
protected static String |
UPDATE_ASSOCIATION |
| Modifier | Constructor and Description |
|---|---|
protected |
TopiaCsvImports() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends TopiaEntityEnum,M extends MetaFilenameAware<T>> |
discoverEntries(Iterable<M> possibleMetas,
File directory,
List<String> missingEntries)
Discover all files that can be imported (as a table or an association) from a directory.
|
static <T extends TopiaEntityEnum,M extends MetaFilenameAware<T>> |
discoverEntries(String entryPrefix,
Iterable<M> possibleMetas,
ZipFile zipFile,
List<String> missingEntries)
Discover all files that can be imported (as a table or an association) from a zipfile.
|
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importAllEntities(TopiaDAO<E> dao,
TableMeta<T> meta,
org.nuiton.csv.Import<E> importer,
CsvImportResult<T> csvResult) |
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importAllEntities(TopiaDAO<E> dao,
TableMeta<T> meta,
org.nuiton.csv.Import<E> importer,
CsvImportResult<T> csvResult,
int nbRowBuffer) |
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importAllEntitiesAndReturnThem(TopiaDAO<E> dao,
TableMeta<T> meta,
org.nuiton.csv.Import<E> importer,
CsvImportResult<T> csvResult) |
static <T extends TopiaEntityEnum> |
importAssociation(Reader reader,
ImportStrategy<T> importStrategy,
AssociationMeta<T> meta,
CsvImportResult<T> csvResult)
To import a association (given by his
meta) from a reader and a strategy. |
static <T extends TopiaEntityEnum> |
importAssociation(TopiaContext tx,
AssociationMeta<T> meta,
org.nuiton.csv.ImportToMap importer,
CsvImportResult<T> csvResult,
int nbRowBuffer) |
static <T extends TopiaEntityEnum> |
importAssociation(TopiaContext tx,
AssociationMeta<T> meta,
Map<String,TopiaEntity> universe,
org.nuiton.csv.ImportToMap importer,
CsvImportResult<T> csvResult,
int nbRowBuffer) |
static <T extends TopiaEntityEnum> |
importNMAssociation(TopiaContext tx,
AssociationMeta<T> meta,
org.nuiton.csv.ImportToMap importer,
CsvImportResult<T> csvResult,
int nbRowBuffer) |
static <T extends TopiaEntityEnum> |
importNMAssociation(TopiaContext tx,
AssociationMeta<T> meta,
Map<String,TopiaEntity> universe,
org.nuiton.csv.ImportToMap importer,
CsvImportResult<T> csvResult,
int nbRowBuffer) |
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importNotExistingEntities(TopiaDAO<E> dao,
TableMeta<T> meta,
Map<String,TopiaEntity> universe,
org.nuiton.csv.Import<E> importer,
CsvImportResult<T> csvResult) |
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importTable(Reader reader,
ImportStrategy<T> importStrategy,
TableMeta<T> meta,
CsvImportResult<T> csvResult)
To import a table (given by his
meta) from a reader and a strategy. |
static <T extends TopiaEntityEnum,E extends TopiaEntity> |
importTableAndReturn(Reader reader,
ImportStrategy<T> importStrategy,
TableMeta<T> meta,
CsvImportResult<T> csvResult)
To import a table (given by his
meta) from a reader and a strategy. |
protected static final String UPDATE_ASSOCIATION
protected static final String INSERT_ASSOCIATION
public static <T extends TopiaEntityEnum,M extends MetaFilenameAware<T>> Map<M,ZipEntry> discoverEntries(String entryPrefix, Iterable<M> possibleMetas, ZipFile zipFile, List<String> missingEntries)
T - type of topia entity enumM - type of data to import (table or association)entryPrefix - prefix where to find files in the zippossibleMetas - list of possible meta to be importedzipFile - zip file where to seek for csv files to importmissingEntries - to fill missing filespublic static <T extends TopiaEntityEnum,M extends MetaFilenameAware<T>> Map<M,File> discoverEntries(Iterable<M> possibleMetas, File directory, List<String> missingEntries)
T - type of topia entity enumM - type of data to import (table or association)possibleMetas - list of possible meta to be importeddirectory - directory where to seek for csv files to importmissingEntries - to fill missing filespublic static <T extends TopiaEntityEnum,E extends TopiaEntity> void importTable(Reader reader, ImportStrategy<T> importStrategy, TableMeta<T> meta, CsvImportResult<T> csvResult) throws TopiaException, IOException
meta) from a reader and a strategy.
Result of import can be stored in an optional csv result.T - type of entity enumE - type of datareader - where to read csv dataimportStrategy - import strategy used to store csv datameta - meta of the datacsvResult - optional csv resultTopiaException - if any db problem while storing datasIOException - if any pb while reading csv dataImportStrategy.importTable(TableMeta, Import, CsvImportResult)public static <T extends TopiaEntityEnum,E extends TopiaEntity> Iterable<E> importTableAndReturn(Reader reader, ImportStrategy<T> importStrategy, TableMeta<T> meta, CsvImportResult<T> csvResult) throws TopiaException, IOException
meta) from a reader and a strategy.
Result of import can be stored in an optional csv result.T - type of entity enumE - type of datareader - where to read csv dataimportStrategy - import strategy used to store csv datameta - meta of the datacsvResult - optional csv resultTopiaException - if any db problem while storing datasIOException - if any pb while reading csv dataImportStrategy.importTable(TableMeta, Import, CsvImportResult)public static <T extends TopiaEntityEnum> void importAssociation(Reader reader, ImportStrategy<T> importStrategy, AssociationMeta<T> meta, CsvImportResult<T> csvResult) throws IOException, TopiaException
meta) from a reader and a strategy.
Result of import can be stored in an optional csv result.T - type of entity enumreader - where to read csv dataimportStrategy - import strategy used to store csv datameta - meta of the datacsvResult - optional csv resultTopiaException - if any db problem while storing datasIOException - if any pb while reading csv dataImportStrategy.importAssociation(AssociationMeta, ImportToMap, CsvImportResult)public static <T extends TopiaEntityEnum,E extends TopiaEntity> void importAllEntities(TopiaDAO<E> dao, TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum,E extends TopiaEntity> void importAllEntities(TopiaDAO<E> dao, TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult, int nbRowBuffer) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum,E extends TopiaEntity> Iterable<E> importAllEntitiesAndReturnThem(TopiaDAO<E> dao, TableMeta<T> meta, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum,E extends TopiaEntity> void importNotExistingEntities(TopiaDAO<E> dao, TableMeta<T> meta, Map<String,TopiaEntity> universe, org.nuiton.csv.Import<E> importer, CsvImportResult<T> csvResult) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum> void importAssociation(TopiaContext tx, AssociationMeta<T> meta, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult, int nbRowBuffer) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum> void importNMAssociation(TopiaContext tx, AssociationMeta<T> meta, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult, int nbRowBuffer) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum> void importNMAssociation(TopiaContext tx, AssociationMeta<T> meta, Map<String,TopiaEntity> universe, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult, int nbRowBuffer) throws TopiaException
TopiaExceptionpublic static <T extends TopiaEntityEnum> void importAssociation(TopiaContext tx, AssociationMeta<T> meta, Map<String,TopiaEntity> universe, org.nuiton.csv.ImportToMap importer, CsvImportResult<T> csvResult, int nbRowBuffer) throws TopiaException
TopiaExceptionCopyright © 2004–2022 Code Lutin. All rights reserved.