Package net.ontopia.persistence.rdbms
Class GenericSQLProducer
java.lang.Object
net.ontopia.persistence.rdbms.GenericSQLProducer
- Direct Known Subclasses:
DB2SQLProducer,FirebirdSQLProducer,MySqlSQLProducer,OracleSQLProducer,PostgreSQLProducer,SQLServerSQLProducer
INTERNAL: Class that generates DDL statements for the generic
database platform.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGenericSQLProducer(Project project) GenericSQLProducer(Project project, String[] platforms) -
Method Summary
Modifier and TypeMethodDescriptionINTERNAL: Generate the DDL statement(s) to add foreigns keys for the specified column.addPrimaryKeys(Table table, List<String> statements) INTERNAL: Generate the DDL statement(s) to add primary keys for the specified table.createIndexes(Table table, List<String> statements) INTERNAL: Generate the DDL statement(s) to create indexes for the specified table.createStatement(Table table, List<String> statements) INTERNAL: Generate the DDL statement(s) to create the specified table.INTERNAL: Generate the DDL statement(s) to drop foreigns keys for the specified column.dropStatement(Table table, List<String> statements) INTERNAL: Generate the DDL statement(s) to drop the specified table.voidexecuteCreate(Connection conn) voidexecuteDrop(Connection conn) protected voidexecuteStatements(List<String> statements, Connection conn) protected StringgetIndexName(Index index) protected StringgetPrimaryKeyName(Table table) protected voidoutputStatements(List<String> statements, Writer writer) protected booleanprotected booleanvoidwriteCreate(Writer writer) INTERNAL: Create the DDL statement(s) to create the database schema.voidINTERNAL: Create the DDL statement(s) to drop the database schema.
-
Field Details
-
project
-
platforms
-
-
Constructor Details
-
GenericSQLProducer
-
GenericSQLProducer
-
-
Method Details
-
writeCreate
INTERNAL: Create the DDL statement(s) to create the database schema.- Throws:
IOException
-
executeCreate
- Throws:
IOExceptionSQLException
-
writeDrop
INTERNAL: Create the DDL statement(s) to drop the database schema.- Throws:
IOException
-
executeDrop
- Throws:
IOExceptionSQLException
-
createStatement
INTERNAL: Generate the DDL statement(s) to create the specified table.- Throws:
IOException
-
getPrimaryKeyName
-
getIndexName
-
supportsNullInColumnDefinition
protected boolean supportsNullInColumnDefinition() -
dropStatement
INTERNAL: Generate the DDL statement(s) to drop the specified table.- Throws:
IOException
-
addPrimaryKeys
INTERNAL: Generate the DDL statement(s) to add primary keys for the specified table. This method should only be implemented if primary keys need to be created by a separate statement.- Throws:
IOException
-
addForeignKey
protected List<String> addForeignKey(Table table, Column col, String keyname, List<String> statements) throws IOException INTERNAL: Generate the DDL statement(s) to add foreigns keys for the specified column. This method should only be implemented if foreign keys need to be created by a separate statement.- Throws:
IOException
-
dropConstraint
protected List<String> dropConstraint(Table table, Column col, String keyname, List<String> statements) throws IOException INTERNAL: Generate the DDL statement(s) to drop foreigns keys for the specified column. This method should only be implemented if foreign keys need to be created by a separate statement.- Throws:
IOException
-
createIndexes
INTERNAL: Generate the DDL statement(s) to create indexes for the specified table.- Throws:
IOException
-
outputStatements
- Throws:
IOException
-
executeStatements
protected void executeStatements(List<String> statements, Connection conn) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
supportsForeignKeys
protected boolean supportsForeignKeys()
-