Class DefaultTargetDatabaseConfiguration
- java.lang.Object
-
- de.akquinet.jbosscc.guttenbase.configuration.impl.AbstractDatabaseConfiguration
-
- de.akquinet.jbosscc.guttenbase.configuration.impl.DefaultTargetDatabaseConfiguration
-
- All Implemented Interfaces:
DatabaseConfiguration
,TargetDatabaseConfiguration
- Direct Known Subclasses:
Db2TargetDatabaseConfiguration
,DerbyTargetDatabaseConfiguration
,ExportDumpDatabaseConfiguration
,GenericTargetDatabaseConfiguration
,H2DbTargetDatabaseConfiguration
,HsqldbTargetDatabaseConfiguration
,MariaDbTargetDatabaseConfiguration
,MsAccessTargetDatabaseConfiguration
,MsSqlTargetDatabaseConfiguration
,MySqlTargetDatabaseConfiguration
,OracleTargetDatabaseConfiguration
,PostgresqlTargetDatabaseConfiguration
public abstract class DefaultTargetDatabaseConfiguration extends AbstractDatabaseConfiguration implements TargetDatabaseConfiguration
(Almost) empty implementation© 2012-2034 akquinet tech@spree
- Author:
- M. Dahm
-
-
Field Summary
-
Fields inherited from class de.akquinet.jbosscc.guttenbase.configuration.impl.AbstractDatabaseConfiguration
_connectorRepository
-
-
Constructor Summary
Constructors Constructor Description DefaultTargetDatabaseConfiguration(ConnectorRepository connectorRepository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterInsert(Connection connection, String connectorId, TableMetaData table)
Called after an INSERT clause is executed.void
afterNewRow(Connection connection, String connectorId, TableMetaData table)
Called after a new row of data (VALUES clause) has been added to the INSERT statement.void
beforeInsert(Connection connection, String connectorId, TableMetaData table)
Called before an INSERT clause is executed.void
beforeNewRow(Connection connection, String connectorId, TableMetaData table)
Called before a new row of data (VALUES clause) is added to the INSERT statement.void
finalizeTargetConnection(Connection connection, String connectorId)
Called after actions have been performed.void
initializeTargetConnection(Connection connection, String connectorId)
Connection is set autocommit false.boolean
isMayCommit()
If running within a container managed transaction such as within an EJB we cannot call commit() on the connection.-
Methods inherited from class de.akquinet.jbosscc.guttenbase.configuration.impl.AbstractDatabaseConfiguration
afterTableCopy, beforeTableCopy, executeSQL
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.akquinet.jbosscc.guttenbase.configuration.DatabaseConfiguration
afterTableCopy, beforeTableCopy
-
-
-
-
Constructor Detail
-
DefaultTargetDatabaseConfiguration
public DefaultTargetDatabaseConfiguration(ConnectorRepository connectorRepository)
-
-
Method Detail
-
isMayCommit
public boolean isMayCommit()
If running within a container managed transaction such as within an EJB we cannot call commit() on the connection. This method should return false then.true by default
- Specified by:
isMayCommit
in interfaceTargetDatabaseConfiguration
-
initializeTargetConnection
public void initializeTargetConnection(Connection connection, String connectorId) throws SQLException
Connection is set autocommit false.Called before any action is performed which may alter the state of the target data base.
Implementing classes usually disable foreign key and other constraints temporarily.
- Specified by:
initializeTargetConnection
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
finalizeTargetConnection
public void finalizeTargetConnection(Connection connection, String connectorId) throws SQLException
Called after actions have been performed.Implementing classes usually re-enable foreign key and other constraints.
- Specified by:
finalizeTargetConnection
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
beforeInsert
public void beforeInsert(Connection connection, String connectorId, TableMetaData table) throws SQLException
Called before an INSERT clause is executed. E.g., in order to disable foreign key constraints. Note that an INSERT statement may have multiple VALUES clauses.- Specified by:
beforeInsert
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
afterInsert
public void afterInsert(Connection connection, String connectorId, TableMetaData table) throws SQLException
Called after an INSERT clause is executed. E.g., in order to re-enable foreign key constraints.- Specified by:
afterInsert
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
beforeNewRow
public void beforeNewRow(Connection connection, String connectorId, TableMetaData table) throws SQLException
Called before a new row of data (VALUES clause) is added to the INSERT statement. Note that an INSERT statement may have multiple VALUES clauses. This method will be called for every VALUES clause.- Specified by:
beforeNewRow
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
afterNewRow
public void afterNewRow(Connection connection, String connectorId, TableMetaData table) throws SQLException
Called after a new row of data (VALUES clause) has been added to the INSERT statement.- Specified by:
afterNewRow
in interfaceTargetDatabaseConfiguration
- Throws:
SQLException
-
-