SQLLogging revert

Revert main table definition class used by SQLLogging to
PamTableDefinition, back from EmptyTableDefinition, to maintain
compatibility with existing plugin modules.
This commit is contained in:
Douglas Gillespie 2023-12-06 12:20:40 +00:00
parent 9939e8aa85
commit bafe93e7f5
5 changed files with 11 additions and 11 deletions

View File

@ -127,7 +127,7 @@ public abstract class OneStopAnnotationHandler extends AnnotationChoiceHandler i
return; return;
} }
// get, modify and set the modified tabelDef // get, modify and set the modified tabelDef
EmptyTableDefinition tableDef = logging.getBaseTableDefinition(); PamTableDefinition tableDef = logging.getBaseTableDefinition();
logging.setTableDefinition(tableDef); logging.setTableDefinition(tableDef);
addAnnotationSqlAddons(logging); // this will add the additional columns. addAnnotationSqlAddons(logging); // this will add the additional columns.
DBControlUnit dbc = DBControlUnit.findDatabaseControl(); DBControlUnit dbc = DBControlUnit.findDatabaseControl();

View File

@ -13,7 +13,7 @@ import PamController.settings.output.xml.PamguardXMLWriter;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamguardMVC.PamDataUnit; import PamguardMVC.PamDataUnit;
/** /**
* 2022 Additional say of saving settings for each module into the database in more human readable * 2022 Additional way of saving settings for each module into the database in more human readable
* XML format. <p> * XML format. <p>
* In other ways, similar to LogSettings which saves serialised Java. This will write a line * In other ways, similar to LogSettings which saves serialised Java. This will write a line
* per module. A main difference is that on pamStop it will update the end time for each line, so * per module. A main difference is that on pamStop it will update the end time for each line, so

View File

@ -92,7 +92,7 @@ public abstract class SQLLogging {
* Reference to the table definition object. * Reference to the table definition object.
* This MUST be set from within the concrete logging class. * This MUST be set from within the concrete logging class.
*/ */
private EmptyTableDefinition pamTableDefinition; private PamTableDefinition pamTableDefinition;
/** /**
* More and more data blocks are starting to use annotations, which require * More and more data blocks are starting to use annotations, which require
@ -102,7 +102,7 @@ public abstract class SQLLogging {
* table definition is set, so that it can be got and modified by the * table definition is set, so that it can be got and modified by the
* annotation handler shortly after the main table is created. * annotation handler shortly after the main table is created.
*/ */
private EmptyTableDefinition baseTableDefinition; private PamTableDefinition baseTableDefinition;
// private long selectT1, selectT2; // private long selectT1, selectT2;
private PamViewParameters currentViewParameters; private PamViewParameters currentViewParameters;
@ -234,7 +234,7 @@ public abstract class SQLLogging {
* @return a Pamguard database table definition object * @return a Pamguard database table definition object
* @see PamTableDefinition * @see PamTableDefinition
*/ */
public final EmptyTableDefinition getTableDefinition() { public final PamTableDefinition getTableDefinition() {
return pamTableDefinition; return pamTableDefinition;
} }
@ -243,7 +243,7 @@ public abstract class SQLLogging {
* *
* @param pamTableDefinition PamTableDefinition to set * @param pamTableDefinition PamTableDefinition to set
*/ */
public void setTableDefinition(EmptyTableDefinition pamTableDefinition) { public void setTableDefinition(PamTableDefinition pamTableDefinition) {
this.pamTableDefinition = pamTableDefinition; this.pamTableDefinition = pamTableDefinition;
if (baseTableDefinition == null && pamTableDefinition != null) { if (baseTableDefinition == null && pamTableDefinition != null) {
baseTableDefinition = pamTableDefinition.clone(); baseTableDefinition = pamTableDefinition.clone();
@ -1827,7 +1827,7 @@ public abstract class SQLLogging {
* annotation handler shortly after the main table is created. * annotation handler shortly after the main table is created.
* @return the baseTableDefinition * @return the baseTableDefinition
*/ */
public EmptyTableDefinition getBaseTableDefinition() { public PamTableDefinition getBaseTableDefinition() {
return baseTableDefinition; return baseTableDefinition;
} }

View File

@ -4,7 +4,7 @@ import java.sql.Types;
import PamguardMVC.PamConstants; import PamguardMVC.PamConstants;
public class XMLSettingsTableDefinition extends EmptyTableDefinition { public class XMLSettingsTableDefinition extends PamTableDefinition {
private PamTableItem dataStart, dataEnd, processStart, processEnd, type, name, pamGuardVersion, settingsVersion, xmlSettings; private PamTableItem dataStart, dataEnd, processStart, processEnd, type, name, pamGuardVersion, settingsVersion, xmlSettings;

View File

@ -34,14 +34,14 @@ public class TowedArray3DSQLLogging extends PamDetectionLogging {
this.towedArray3DController = towedArray3DController; this.towedArray3DController = towedArray3DController;
// create the table definition. // create the table definition.
EmptyTableDefinition tableDefinition = createTableDefinition(); PamTableDefinition tableDefinition = createTableDefinition();
} }
public EmptyTableDefinition createTableDefinition() { public PamTableDefinition createTableDefinition() {
// PamTableDefinition tableDef = new PamTableDefinition(towedArray3DController.getUnitName(), getUpdatePolicy()); // PamTableDefinition tableDef = new PamTableDefinition(towedArray3DController.getUnitName(), getUpdatePolicy());
EmptyTableDefinition tableDef = super.getTableDefinition(); PamTableDefinition tableDef = super.getTableDefinition();
tableDef.setUpdatePolicy(SQLLogging.UPDATE_POLICY_WRITENEW); tableDef.setUpdatePolicy(SQLLogging.UPDATE_POLICY_WRITENEW);
// PamTableItem tableItem; // PamTableItem tableItem;