* @see net.sf.hajdbc.sync.SynchronizationSupport#restoreForeignKeys()
*/
@Override
public void restoreForeignKeys() throws SQLException
{
Dialect dialect = this.context.getDialect();
Connection connection = this.context.getConnection(this.context.getTargetDatabase());
boolean autoCommit = connection.getAutoCommit();
try
{
connection.setAutoCommit(true);
Statement statement = connection.createStatement();
try
{
for (TableProperties table: this.context.getSourceDatabaseProperties().getTables())
{
for (ForeignKeyConstraint constraint: table.getForeignKeyConstraints())
{
String sql = dialect.getCreateForeignKeyConstraintSQL(constraint);
this.logger.log(Level.DEBUG, sql);
statement.addBatch(sql);
}