2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.database
.update
;
11 import java
.sql
.SQLException
;
13 import eu
.etaxonomy
.cdm
.common
.monitor
.IProgressMonitor
;
14 import eu
.etaxonomy
.cdm
.database
.ICdmDataSource
;
17 * Base class for a {@link ISchemaUpdaterStep schema update step} which supports automated handling
27 public abstract class AuditedSchemaUpdaterStepBase
<T
extends AuditedSchemaUpdaterStepBase
<T
>> extends SchemaUpdaterStepBase
<T
> implements ISchemaUpdaterStep
{
29 protected String tableName
;
30 protected boolean includeAudTable
;
31 protected boolean isAuditing
;
38 protected AuditedSchemaUpdaterStepBase(String stepName
) {
43 public Integer
invoke(ICdmDataSource datasource
, IProgressMonitor monitor
, CaseType caseType
) throws SQLException
{
44 boolean result
= true;
46 result
&= invokeOnTable(caseType
.transformTo(tableName
), datasource
, monitor
, caseType
);
50 result
&= invokeOnTable(caseType
.transformTo(tableName
+ aud
), datasource
, monitor
, caseType
);
52 return (result
== true )?
0 : null;
56 * Invoke the update on the given table of name tableName.
57 * @param tableName the tableName, already in the correct case
58 * @param datasource the data source
59 * @param monitor the monitor
60 * @param caseType the caseType (in case other tables are also affected
63 protected abstract boolean invokeOnTable(String tableName
, ICdmDataSource datasource
, IProgressMonitor monitor
, CaseType caseType
);