From bafe93e7f54ceb38859b610d6aa1bc7ee13be501 Mon Sep 17 00:00:00 2001 From: Douglas Gillespie <50671166+douggillespie@users.noreply.github.com> Date: Wed, 6 Dec 2023 12:20:40 +0000 Subject: [PATCH] SQLLogging revert Revert main table definition class used by SQLLogging to PamTableDefinition, back from EmptyTableDefinition, to maintain compatibility with existing plugin modules. --- src/annotation/handler/OneStopAnnotationHandler.java | 2 +- src/generalDatabase/LogXMLSettings.java | 2 +- src/generalDatabase/SQLLogging.java | 10 +++++----- src/generalDatabase/XMLSettingsTableDefinition.java | 2 +- src/loc3d_Thode/TowedArray3DSQLLogging.java | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/annotation/handler/OneStopAnnotationHandler.java b/src/annotation/handler/OneStopAnnotationHandler.java index 50dc1983..1b2caa34 100644 --- a/src/annotation/handler/OneStopAnnotationHandler.java +++ b/src/annotation/handler/OneStopAnnotationHandler.java @@ -127,7 +127,7 @@ public abstract class OneStopAnnotationHandler extends AnnotationChoiceHandler i return; } // get, modify and set the modified tabelDef - EmptyTableDefinition tableDef = logging.getBaseTableDefinition(); + PamTableDefinition tableDef = logging.getBaseTableDefinition(); logging.setTableDefinition(tableDef); addAnnotationSqlAddons(logging); // this will add the additional columns. DBControlUnit dbc = DBControlUnit.findDatabaseControl(); diff --git a/src/generalDatabase/LogXMLSettings.java b/src/generalDatabase/LogXMLSettings.java index 76a576b5..3f33c188 100644 --- a/src/generalDatabase/LogXMLSettings.java +++ b/src/generalDatabase/LogXMLSettings.java @@ -13,7 +13,7 @@ import PamController.settings.output.xml.PamguardXMLWriter; import PamUtils.PamCalendar; 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.
* 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 diff --git a/src/generalDatabase/SQLLogging.java b/src/generalDatabase/SQLLogging.java index deb195cf..74aa9066 100644 --- a/src/generalDatabase/SQLLogging.java +++ b/src/generalDatabase/SQLLogging.java @@ -92,7 +92,7 @@ public abstract class SQLLogging { * Reference to the table definition object. * 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 @@ -102,7 +102,7 @@ public abstract class SQLLogging { * table definition is set, so that it can be got and modified by the * annotation handler shortly after the main table is created. */ - private EmptyTableDefinition baseTableDefinition; + private PamTableDefinition baseTableDefinition; // private long selectT1, selectT2; private PamViewParameters currentViewParameters; @@ -234,7 +234,7 @@ public abstract class SQLLogging { * @return a Pamguard database table definition object * @see PamTableDefinition */ - public final EmptyTableDefinition getTableDefinition() { + public final PamTableDefinition getTableDefinition() { return pamTableDefinition; } @@ -243,7 +243,7 @@ public abstract class SQLLogging { * * @param pamTableDefinition PamTableDefinition to set */ - public void setTableDefinition(EmptyTableDefinition pamTableDefinition) { + public void setTableDefinition(PamTableDefinition pamTableDefinition) { this.pamTableDefinition = pamTableDefinition; if (baseTableDefinition == null && pamTableDefinition != null) { baseTableDefinition = pamTableDefinition.clone(); @@ -1827,7 +1827,7 @@ public abstract class SQLLogging { * annotation handler shortly after the main table is created. * @return the baseTableDefinition */ - public EmptyTableDefinition getBaseTableDefinition() { + public PamTableDefinition getBaseTableDefinition() { return baseTableDefinition; } diff --git a/src/generalDatabase/XMLSettingsTableDefinition.java b/src/generalDatabase/XMLSettingsTableDefinition.java index d09b8f05..8d40bc55 100644 --- a/src/generalDatabase/XMLSettingsTableDefinition.java +++ b/src/generalDatabase/XMLSettingsTableDefinition.java @@ -4,7 +4,7 @@ import java.sql.Types; import PamguardMVC.PamConstants; -public class XMLSettingsTableDefinition extends EmptyTableDefinition { +public class XMLSettingsTableDefinition extends PamTableDefinition { private PamTableItem dataStart, dataEnd, processStart, processEnd, type, name, pamGuardVersion, settingsVersion, xmlSettings; diff --git a/src/loc3d_Thode/TowedArray3DSQLLogging.java b/src/loc3d_Thode/TowedArray3DSQLLogging.java index 108c000c..95bc98e6 100644 --- a/src/loc3d_Thode/TowedArray3DSQLLogging.java +++ b/src/loc3d_Thode/TowedArray3DSQLLogging.java @@ -34,14 +34,14 @@ public class TowedArray3DSQLLogging extends PamDetectionLogging { this.towedArray3DController = towedArray3DController; // create the table definition. - EmptyTableDefinition tableDefinition = createTableDefinition(); + PamTableDefinition tableDefinition = createTableDefinition(); } - public EmptyTableDefinition createTableDefinition() { + public PamTableDefinition createTableDefinition() { // PamTableDefinition tableDef = new PamTableDefinition(towedArray3DController.getUnitName(), getUpdatePolicy()); - EmptyTableDefinition tableDef = super.getTableDefinition(); + PamTableDefinition tableDef = super.getTableDefinition(); tableDef.setUpdatePolicy(SQLLogging.UPDATE_POLICY_WRITENEW); // PamTableItem tableItem;