public class DdlGenerator extends Object implements com.avaje.ebeaninternal.api.SpiEbeanPlugin
| Constructor and Description |
|---|
DdlGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected com.avaje.ebean.dbmigration.model.CurrentModel |
currentModel() |
void |
execute(boolean online)
Generate the DDL and then run the DDL based on property settings
(ebean.ddl.generate and ebean.ddl.run etc).
|
String |
generateCreateDdl() |
void |
generateDdl()
Generate the DDL drop and create scripts if the properties have been set.
|
String |
generateDropDdl() |
protected String |
getCreateFileName() |
protected String |
getDropFileName() |
protected List<String> |
parseStatements(StringReader reader)
Break up the sql in reader into a list of statements using the semi-colon
character;
|
protected String |
readFile(String fileName) |
void |
runDdl()
Run the DDL drop and DDL create scripts if properties have been set.
|
void |
runScript(boolean expectErrors,
String content)
Execute all the DDL statements in the script.
|
void |
setup(com.avaje.ebeaninternal.api.SpiEbeanServer server,
ServerConfig serverConfig)
initializes the plugin.
|
protected void |
writeCreate(String createFile) |
protected void |
writeDrop(String dropFile) |
protected void |
writeFile(String fileName,
String fileContent) |
public DdlGenerator()
public void setup(com.avaje.ebeaninternal.api.SpiEbeanServer server, ServerConfig serverConfig)
com.avaje.ebeaninternal.api.SpiEbeanPluginsetup in interface com.avaje.ebeaninternal.api.SpiEbeanPluginserver - - the ebean server with extensions for all of the Ebean internalsserverConfig - - the configured server information. It allows access to pre-collected information (but not the collector PropertySource, yet)public void execute(boolean online)
execute in interface com.avaje.ebeaninternal.api.SpiEbeanPluginpublic void generateDdl()
public void runDdl()
protected void writeCreate(String createFile)
public String generateDropDdl()
public String generateCreateDdl()
protected String getDropFileName()
protected String getCreateFileName()
protected com.avaje.ebean.dbmigration.model.CurrentModel currentModel()
protected void writeFile(String fileName, String fileContent) throws IOException
IOExceptionprotected String readFile(String fileName) throws IOException
IOExceptionpublic void runScript(boolean expectErrors, String content)
protected List<String> parseStatements(StringReader reader)
Copyright © 2015. All rights reserved.