public final class EntityImporter extends Object
DataProvider
and creates one big SQL file for the
generated entities
.Modifier and Type | Field and Description |
---|---|
static String |
DATA_FOLDER_KEY
Settings key for the folder that contains any data to import.
|
static String |
GENERATION_ABORTED_MESSAGE
The String in the SQL, if the generation was aborted.
|
static String |
OUTPUT_ENCODING_KEY
Settings key for the encoding of the generated SQL file.
|
static String |
OUTPUT_FILE_KEY
Settings key for the generated SQL file.
|
static String |
PACKAGES_KEY
Settings key for the packages to scan.
|
static String |
POSTFIX_KEY
Settings key for a part to write into the output file after the generated content.
|
static String |
PREFIX_KEY
Settings key for a part to write into the output file before the generated content.
|
Constructor and Description |
---|
EntityImporter()
Creates a new default instance of an EntityImporter.
|
EntityImporter(Properties settings)
Creates a new instance of an EntityImporter.
|
EntityImporter(Properties settings,
File dataFolder,
GeneratorContext context)
Creates a new instance of an EntityImporter.
|
Modifier and Type | Method and Description |
---|---|
void |
importData()
Imports the data and creates the default SQL file.
|
void |
importData(File targetFile)
Imports the data and creates the given SQL file.
|
void |
importData(Writer writer)
Asks the data providers to generate their entities and writes the SQL afterwards.
|
static void |
main(String[] args)
Starts the entity importer from the command line.
|
public static final String GENERATION_ABORTED_MESSAGE
public static final String DATA_FOLDER_KEY
public static final String OUTPUT_FILE_KEY
public static final String OUTPUT_ENCODING_KEY
public static final String PREFIX_KEY
public static final String POSTFIX_KEY
public static final String PACKAGES_KEY
public EntityImporter()
public EntityImporter(Properties settings)
settings
- the settings of this importer andpublic EntityImporter(Properties settings, File dataFolder, GeneratorContext context)
settings
- contains additional settings for this importerdataFolder
- the base folder for the data providerscontext
- the current generator contextpublic static void main(String[] args) throws IOException
EntityImporter(Properties)
or GeneratorContext
with system
propertiesargs
- the command line arguments (see above)IOException
- the exceptionpublic void importData() throws IOException
IOException
- if one of the data importers or the file writer throws onepublic void importData(File targetFile) throws IOException
targetFile
- the SQL file to generateIOException
- if one of the data importers or the file writer throws onepublic void importData(Writer writer) throws IOException
writer
- the target writer forIOException
- if the generator throws an exceptionCopyright © 2016 fastnate.org. All rights reserved.