Class AbstractDataProvider

java.lang.Object
org.fastnate.data.AbstractDataProvider
All Implemented Interfaces:
DataProvider

public abstract class AbstractDataProvider extends Object implements 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 Properties settings
  • references to other DataProviders
If references to other DataProviders are used in the constructor, the DataProvider.buildEntities() method of these providers are called before our DataProvider.buildEntities().
Author:
Andreas Penski, Tobias Liefke
  • Constructor Details

    • AbstractDataProvider

      public AbstractDataProvider()
  • Method Details

    • getEntities

      protected abstract Collection<?> getEntities()
      The list of entities for which INSERT SQL statements will be generated.
      Returns:
      list of entities
    • writeEntities

      public void writeEntities(org.fastnate.generator.EntitySqlGenerator sqlGenerator) throws IOException
      The default implementation just writes all entities that were created during DataProvider.buildEntities().
      Specified by:
      writeEntities in interface DataProvider
      Parameters:
      sqlGenerator - the SQL file generator
      Throws:
      IOException - if the generator throws one