public class GenericSQLProducer extends Object
Modifier and Type | Field and Description |
---|---|
protected String[] |
platforms |
protected Project |
project |
Constructor and Description |
---|
GenericSQLProducer(Project project) |
GenericSQLProducer(Project project,
String[] platforms) |
Modifier and Type | Method and Description |
---|---|
protected List<String> |
addForeignKey(Table table,
Column col,
String keyname,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to add foreigns keys for
the specified column.
|
protected List<String> |
addPrimaryKeys(Table table,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to add primary keys for
the specified table.
|
protected List<String> |
createIndexes(Table table,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to create indexes for the
specified table.
|
protected List<String> |
createStatement(Table table,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to create the specified table.
|
protected List<String> |
dropConstraint(Table table,
Column col,
String keyname,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to drop foreigns keys for
the specified column.
|
protected List<String> |
dropStatement(Table table,
List<String> statements)
INTERNAL: Generate the DDL statement(s) to drop the specified table.
|
void |
executeCreate(Connection conn) |
void |
executeDrop(Connection conn) |
protected void |
executeStatements(List<String> statements,
Connection conn) |
protected String |
getIndexName(Index index) |
protected String |
getPrimaryKeyName(Table table) |
protected void |
outputStatements(List<String> statements,
Writer writer) |
protected boolean |
supportsForeignKeys() |
protected boolean |
supportsNullInColumnDefinition() |
void |
writeCreate(Writer writer)
INTERNAL: Create the DDL statement(s) to create the database schema.
|
void |
writeDrop(Writer writer)
INTERNAL: Create the DDL statement(s) to drop the database schema.
|
public GenericSQLProducer(Project project)
public void writeCreate(Writer writer) throws IOException
IOException
public void executeCreate(Connection conn) throws IOException, SQLException
IOException
SQLException
public void writeDrop(Writer writer) throws IOException
IOException
public void executeDrop(Connection conn) throws IOException, SQLException
IOException
SQLException
protected List<String> createStatement(Table table, List<String> statements) throws IOException
IOException
protected boolean supportsNullInColumnDefinition()
protected List<String> dropStatement(Table table, List<String> statements) throws IOException
IOException
protected List<String> addPrimaryKeys(Table table, List<String> statements) throws IOException
IOException
protected List<String> addForeignKey(Table table, Column col, String keyname, List<String> statements) throws IOException
IOException
protected List<String> dropConstraint(Table table, Column col, String keyname, List<String> statements) throws IOException
IOException
protected List<String> createIndexes(Table table, List<String> statements) throws IOException
IOException
protected void outputStatements(List<String> statements, Writer writer) throws IOException
IOException
protected void executeStatements(List<String> statements, Connection conn) throws IOException, SQLException
IOException
SQLException
protected boolean supportsForeignKeys()