Package org.fastnate.data
Interface DataProvider
- All Known Implementing Classes:
AbstractDataProvider,EntityRegistration,GenericDataProvider,GenericXmlDataProvider
public interface DataProvider
Implementations of this class will automatically instantiated by the
EntityImporter.
The constructor must either be the "no arguments constructor" - or accept one or more of the following parameters:
- the data directory as
File - the
Propertiessettings - references to other DataProviders
buildEntities() method of these
providers are called before our buildEntities().- Author:
- Andreas Penski, Tobias Liefke
-
Method Summary
Modifier and TypeMethodDescriptionvoidBuilds the entities that are accessed later usingwriteEntities(EntitySqlGenerator).default intgetOrder()An additional helper to sort the output by its precedence.voidwriteEntities(org.fastnate.generator.EntitySqlGenerator sqlGenerator) Adds allentitiesto the SQL file using the given generator.
-
Method Details
-
buildEntities
Builds the entities that are accessed later usingwriteEntities(EntitySqlGenerator).- Throws:
IOException- if something happens during any possible import of the generated entities
-
getOrder
default int getOrder()An additional helper to sort the output by its precedence. Providers with a smaller order criteria will write their data before providers with a higher order criteria, except in the case that the first is depending on the second.- Returns:
- the order criteria - defaults to 0
-
writeEntities
Adds allentitiesto the SQL file using the given generator.- Parameters:
sqlGenerator- the SQL file generator- Throws:
IOException- if the generator throws one
-