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
;
21 public abstract class AuditedSchemaUpdaterStepBase
<T
extends AuditedSchemaUpdaterStepBase
<T
>> extends SchemaUpdaterStepBase
<T
> implements ISchemaUpdaterStep
{
23 protected String tableName
;
24 protected boolean includeAudTable
;
25 protected boolean isAuditing
;
32 protected AuditedSchemaUpdaterStepBase(String stepName
) {
37 public Integer
invoke(ICdmDataSource datasource
, IProgressMonitor monitor
, CaseType caseType
) throws SQLException
{
38 boolean result
= true;
40 result
&= invokeOnTable(caseType
.transformTo(tableName
), datasource
, monitor
, caseType
);
44 result
&= invokeOnTable(caseType
.transformTo(tableName
+ aud
), datasource
, monitor
, caseType
);
46 return (result
== true )?
0 : null;
50 * Invoke the update on the given table of name tableName.
51 * @param tableName the tableName, already in the correct case
52 * @param datasource the data source
53 * @param monitor the monitor
54 * @param caseType the caseType (in case other tables are also affected
57 protected abstract boolean invokeOnTable(String tableName
, ICdmDataSource datasource
, IProgressMonitor monitor
, CaseType caseType
);