|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dotmarketing.startup.AbstractJDBCStartupTask
public abstract class AbstractJDBCStartupTask
Derived classes should avoid use of transactions. MSSQL might have
problems to handle a mix of DDL+DML because of the snapshot
insolation setting.
The cleaner way to avoid it is to set autocommit on the threadlocal
connection DbConnectionFactory.getConnection().setAutoCommit(true).
So DotConnect and HibernateUtil will not have problems with MSSQL.
| Nested Class Summary | |
|---|---|
class |
AbstractJDBCStartupTask.ForeignKey
|
class |
AbstractJDBCStartupTask.Index
|
class |
AbstractJDBCStartupTask.PrimaryKey
|
| Field Summary | |
|---|---|
protected boolean |
runInSingleTransaction
By default statements should run in a single transaction. |
| Constructor Summary | |
|---|---|
AbstractJDBCStartupTask()
|
|
| Method Summary | |
|---|---|
protected void |
createConstraint(java.sql.Connection conn,
AbstractJDBCStartupTask.ForeignKey key)
|
protected void |
createIndex(java.sql.Connection conn,
AbstractJDBCStartupTask.Index index)
|
protected void |
createPrimaryKey(java.sql.Connection conn,
AbstractJDBCStartupTask.PrimaryKey key)
|
protected void |
executeDropConstraint(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
|
protected void |
executeDropForeignKeyMySql(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
|
protected void |
executeDropIndex(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
|
void |
executeUpgrade()
The instructions to execute. |
protected java.lang.String |
getColumnList(java.util.List<java.lang.String> columns)
|
protected java.util.List<AbstractJDBCStartupTask.ForeignKey> |
getForeingKeys(java.sql.Connection conn,
java.util.List<java.lang.String> tables,
boolean executeDrop)
|
protected java.util.List<AbstractJDBCStartupTask.Index> |
getIndexes(java.sql.Connection conn,
java.util.List<java.lang.String> tables,
boolean executeDrop)
|
abstract java.lang.String |
getMSSQLScript()
The SQL for MSSQL |
abstract java.lang.String |
getMySQLScript()
The SQL MySQL |
abstract java.lang.String |
getOracleScript()
The SQL for Oracle |
abstract java.lang.String |
getPostgresScript()
The SQL for Postgres |
protected java.util.List<AbstractJDBCStartupTask.PrimaryKey> |
getPrimaryKey(java.sql.Connection conn,
java.util.List<java.lang.String> tablesWithKeys,
boolean drop)
|
protected abstract java.util.List<java.lang.String> |
getTablesToDropConstraints()
This is a list of tables which will get the constraints dropped prior to the task executing and then get recreated afer the execution of the DB Specific SQL |
protected java.util.List<java.lang.String> |
getTablesToDropPrimaryKeys()
|
protected void |
setRebuildForeignKeys(java.lang.Boolean rebuildForeignKeys)
|
protected void |
setRebuildIndices(java.lang.Boolean rebuildIndices)
|
protected void |
setRebuildPrimaryKeys(java.lang.Boolean rebuildPrimaryKeys)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.dotmarketing.startup.StartupTask |
|---|
forceRun |
| Field Detail |
|---|
protected boolean runInSingleTransaction
| Constructor Detail |
|---|
public AbstractJDBCStartupTask()
| Method Detail |
|---|
public void executeUpgrade()
throws DotDataException,
DotRuntimeException
StartupTask
executeUpgrade in interface StartupTaskDotDataException
DotRuntimeExceptionprotected java.util.List<java.lang.String> getTablesToDropPrimaryKeys()
protected void executeDropIndex(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
throws java.sql.SQLException
java.sql.SQLException
protected void executeDropConstraint(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
throws java.sql.SQLException
java.sql.SQLException
protected void executeDropForeignKeyMySql(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String constraintName)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.lang.String getColumnList(java.util.List<java.lang.String> columns)
protected void createPrimaryKey(java.sql.Connection conn,
AbstractJDBCStartupTask.PrimaryKey key)
throws java.sql.SQLException
java.sql.SQLException
protected void createIndex(java.sql.Connection conn,
AbstractJDBCStartupTask.Index index)
throws java.sql.SQLException
java.sql.SQLException
protected java.util.List<AbstractJDBCStartupTask.ForeignKey> getForeingKeys(java.sql.Connection conn,
java.util.List<java.lang.String> tables,
boolean executeDrop)
protected java.util.List<AbstractJDBCStartupTask.Index> getIndexes(java.sql.Connection conn,
java.util.List<java.lang.String> tables,
boolean executeDrop)
protected java.util.List<AbstractJDBCStartupTask.PrimaryKey> getPrimaryKey(java.sql.Connection conn,
java.util.List<java.lang.String> tablesWithKeys,
boolean drop)
protected void createConstraint(java.sql.Connection conn,
AbstractJDBCStartupTask.ForeignKey key)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void setRebuildPrimaryKeys(java.lang.Boolean rebuildPrimaryKeys)
protected void setRebuildIndices(java.lang.Boolean rebuildIndices)
protected void setRebuildForeignKeys(java.lang.Boolean rebuildForeignKeys)
public abstract java.lang.String getPostgresScript()
public abstract java.lang.String getMySQLScript()
public abstract java.lang.String getOracleScript()
public abstract java.lang.String getMSSQLScript()
protected abstract java.util.List<java.lang.String> getTablesToDropConstraints()
DotDataException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||