Class PostgresDDLGenerator
java.lang.Object
org.apache.empire.db.DBDDLGenerator<DBMSHandlerPostgreSQL>
org.apache.empire.dbms.postgresql.PostgresDDLGenerator
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.empire.db.DBDDLGenerator
DBDDLGenerator.DDLActionType -
Field Summary
Fields inherited from class org.apache.empire.db.DBDDLGenerator
alterColumnPhrase, databaseObjectName, DATATYPE_BLOB, DATATYPE_BOOLEAN, DATATYPE_CHAR, DATATYPE_CLOB, DATATYPE_DATE, DATATYPE_DATETIME, DATATYPE_DECIMAL, DATATYPE_FLOAT, DATATYPE_INT_BIG, DATATYPE_INT_SMALL, DATATYPE_INTEGER, DATATYPE_TIME, DATATYPE_TIMESTAMP, DATATYPE_UNIQUEID, DATATYPE_VARCHAR, dbms, ddlColumnDefaults, log, namePrimaryKeyConstraint -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanappendColumnDataType(DataType type, double size, DBTableColumn c, DBSQLBuilder sql) appends the data type of a columnprotected voidappendColumnDesc(DBTableColumn c, boolean alter, DBSQLBuilder sql) Appends a table column definition to a ddl statementprotected voidcreateDatabase(DBDatabase db, DBSQLScript script) Appends the DDL-Script for creating the given database to an SQL-Script
This includes the generation of all tables, views and relations.protected voidcreateSequence(DBDatabase db, DBTableColumn column, DBSQLScript script) Appends the DDL-Script for creating a sequence to an SQL-ScriptbooleanReturns whether the reverse function should be created with the databasevoidsetCreateReverseFunction(boolean createReverseFunction) Set whether to create the reverse function with the databaseMethods inherited from class org.apache.empire.db.DBDDLGenerator
addAlterTableStmt, addCreateIndexStmt, addCreateRelationStmt, addCreateTableStmt, addCreateViewStmt, alterTable, appendElementName, appendIndexColumn, appendIndexType, createIndex, createRelation, createTable, createTableIndexes, createView, dropDatabase, dropObject, getDDLScript, isDDLColumnDefaults, setDDLColumnDefaults
-
Constructor Details
-
PostgresDDLGenerator
-
-
Method Details
-
isCreateReverseFunction
public boolean isCreateReverseFunction()Returns whether the reverse function should be created with the database -
setCreateReverseFunction
public void setCreateReverseFunction(boolean createReverseFunction) Set whether to create the reverse function with the database -
appendColumnDataType
protected boolean appendColumnDataType(DataType type, double size, DBTableColumn c, DBSQLBuilder sql) Description copied from class:DBDDLGeneratorappends the data type of a column- Overrides:
appendColumnDataTypein classDBDDLGenerator<DBMSHandlerPostgreSQL>- Parameters:
type- the typesize- the sizec- the table columnsql- the builder that we will append to- Returns:
- true if further column attributes may be added or false otherwise
-
createDatabase
Description copied from class:DBDDLGeneratorAppends the DDL-Script for creating the given database to an SQL-Script
This includes the generation of all tables, views and relations.- Overrides:
createDatabasein classDBDDLGenerator<DBMSHandlerPostgreSQL>- Parameters:
db- the database to createscript- the sql script to which to append the dll command(s)
-
createSequence
Appends the DDL-Script for creating a sequence to an SQL-Script- Parameters:
db- the database to createcolumn- the column for which to create the sequencescript- the sql script to which to append the dll command(s)
-
appendColumnDesc
Description copied from class:DBDDLGeneratorAppends a table column definition to a ddl statement- Overrides:
appendColumnDescin classDBDDLGenerator<DBMSHandlerPostgreSQL>- Parameters:
c- the column which description to appendalter- true if altering an existing column or false otherwisesql- the sql builder object
-