public class DdlGenerator extends Object implements SpiEbeanPlugin
| Constructor and Description |
|---|
DdlGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected DdlGenContext |
createContext() |
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(SpiEbeanServer server,
DatabasePlatform dbPlatform,
ServerConfig serverConfig)
initializes the plugin.
|
protected void |
writeCreate(String createFile) |
protected void |
writeDrop(String dropFile) |
protected void |
writeFile(String fileName,
String fileContent) |
public void setup(SpiEbeanServer server, DatabasePlatform dbPlatform, ServerConfig serverConfig)
SpiEbeanPluginsetup in interface SpiEbeanPluginserver - - the ebean server with extensions for all of the Ebean internalsdbPlatform - - the database we are using - this is available from the server, but it is provided for convenienceserverConfig - - 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 SpiEbeanPluginpublic void generateDdl()
public void runDdl()
protected void writeDrop(String dropFile)
protected void writeCreate(String createFile)
public String generateDropDdl()
public String generateCreateDdl()
protected String getDropFileName()
protected String getCreateFileName()
protected DdlGenContext createContext()
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 © 2014. All Rights Reserved.