Package generalDatabase
Class SuperDetLogging
java.lang.Object
generalDatabase.SQLLogging
generalDatabase.SuperDetLogging
- Direct Known Subclasses:
ClickTrainDetLogging,CPODClickTrainLogging,DetectionGroupLogging,DLGroupDetectionLogging,Group3DLogging,MarkGroupSQLLogging,OfflineEventLogging,QASequenceLogging,QATestLogging
Extensions to SQLLogging to be used with datablocks that log sub detections. All
such blocks will be instances of SuperDetDatablock
- Author:
- Dougl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around database indexes.static final intWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around UID'sstatic final intWhen loading sub table data, load data using the same between times clause as was applied to the super datablockFields inherited from class generalDatabase.SQLLogging
superDetLogging, UPDATE_POLICY_OVERWRITE, UPDATE_POLICY_WRITENEW -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSuperDetLogging(SuperDetDataBlock pamDataBlock) protectedSuperDetLogging(SuperDetDataBlock pamDataBlock, boolean createDataUnits) -
Method Summary
Modifier and TypeMethodDescriptionanySubTableItems(PAMSelectClause mainTableClause, PAMSelectClause subTableClause) find if any sub table items that satisfy a particular clause.intcheckSubTableCount(int databaseIndex) Check the number of entries in the sub table which have this database index.countSubTableItems(PAMSelectClause mainTableClause, PAMSelectClause subTableClause) Count the number of sub table items that satisfy a particular clause.booleanbooleandeleteIndexedItems(PamConnection connection, int[] deleteIndexes) Delete one or more rows from the database based on their indexes.voidintprotected intinsertCursorRow(PamConnection connection, PamCursor pamCursor, PamDataUnit aUnit) Used in standard offline save to add data to a scrollable cursor and adds the cursor row id to the data unit.booleanbooleanloadViewData(PamConnection con, PamViewParameters pamViewParameters, ViewLoadObserver loadObserver) Load viewer data for a single datablock.booleanlogData(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection) Called when a new PamDataUnit is added to a PamDataBlock to write those data to the database.booleanreLogData(PamConnection con, PamDataUnit dataUnit, PamDataUnit superDetection) Called when an old PamDataUnit is updated.booleansaveOfflineData(DBControlUnit dbControlUnit, PamConnection connection) Save offline data in viewer mode.voidsetCreateDataUnits(boolean createDataUnits) voidsetEventEndTimeItem(PamTableItem eventEndTimeItem) voidsetSubLogging(SQLLogging subLogging) voidsetSubTableClausePolicy(int subTableClausePolicy) protected voidupdateCursorRow(PamConnection connection, PamCursor pamCursor, PamDataUnit aUnit) Used in standard offline save to update data in a scrollable cursor.Methods inherited from class generalDatabase.SQLLogging
addAddOn, clearAllAddOns, countTableItems, countTableItems, createDataUnit, createEarlyResultSet, createInClause, createViewResultSet, createViewResultSet, deleteData, deleteData, deleteSubtableItem, deleteSubtableItems, doExtraChecks, double2Float, fillTableData, finalize, findClosestDataPoint, findLogger, getBaseTableDefinition, getEarlyLoadClause, getIdListUpdatClause, getLastLoadIndex, getLastLoadUID, getLastTime, getLoggingAddOns, getPamDataBlock, getTableDefinition, getTimesUpdateClause, getUIDMatchClause, getUpdatePolicy, getViewerCursorFinder, getViewerEverythingClause, getViewerLessThanClause, getViewerLoadClause, getViewerOverlapClause, getViewerUpdateClause, isCanView, isLoadViewData, loadDataFrom, loadEarlyData, loadEarlyData, loadLastDataUnit, loadSubtableData, loadSubtableData, loadViewData, loadViewerData, logData, logSubtableData, prepareEmulation, prepareForMixedMode, readLastData, readMixedModeData, readNextEmulation, reCheckTable, reLogData, removeAddOn, removeAddOn, reset, setCanView, setColumnData, setLoadViewData, setTableData, setTableDefinition, setUpdatePolicy, transferDataFromResult, updateSubtable
-
Field Details
-
SUBTABLECLAUSE_TIME
public static final int SUBTABLECLAUSE_TIMEWhen loading sub table data, load data using the same between times clause as was applied to the super datablock- See Also:
-
SUBTABLECLAUSE_PARENTUID
public static final int SUBTABLECLAUSE_PARENTUIDWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around UID's- See Also:
-
SUBTABLECLAUSE_PARENTDATABASEID
public static final int SUBTABLECLAUSE_PARENTDATABASEIDWhen loading sub table data, load data using a clause which will guarantee loading of all sub detections of loaded super detections based around database indexes.- See Also:
-
-
Constructor Details
-
SuperDetLogging
-
SuperDetLogging
-
-
Method Details
-
getSubLogging
- Returns:
- the subLogging
-
setSubLogging
- Parameters:
subLogging- the subLogging to set
-
logData
Description copied from class:SQLLoggingCalled when a new PamDataUnit is added to a PamDataBlock to write those data to the database. Functionality moved down to PamCursor so that exact writing method can become database specific if necessary.- Overrides:
logDatain classSQLLogging- Parameters:
con- Database ConnectiondataUnit- Pamguard Data unit.superDetection- reference to a super detection so additional cross referencing can be filled- Returns:
- true if written and new index of dataUnit retrieved OK
- See Also:
-
reLogData
Description copied from class:SQLLoggingCalled when an old PamDataUnit is updated. The record is either updated or a new record is written, but cross referenced to the old unit for bookkeeping purposes based on the updatePolicy flag.- Overrides:
reLogDatain classSQLLogging- Parameters:
con- Database ConnectiondataUnit- Pamguard Data unit.superDetection- reference to a super detection so additional cross referencing can be filled- Returns:
- the number of rows written to the database.
- See Also:
-
saveOfflineData
Description copied from class:SQLLoggingSave offline data in viewer mode.This is a pretty basic function which assumes pretty much a 1:1 correspondence between data loaded into the viewer and data to be saved.
Three types of saving to do
- Pre existing 1:1 correspondence between data in memory and database
- Viewer will have added or removed data (e.g. map comments may easily have added data)
- Weird stuff like in the click detector where the database is only holding information about a subset of clicks held in the binary data files
Should be able to deal with first two here, but functions must override for 3.
- Overrides:
saveOfflineDatain classSQLLogging- Parameters:
dbControlUnit-connection-- Returns:
-
loadViewData
public boolean loadViewData(PamConnection con, PamViewParameters pamViewParameters, ViewLoadObserver loadObserver) Description copied from class:SQLLoggingLoad viewer data for a single datablock.this executes in a Swing Worker thread, so needs to send notification objects to that thread, and not direct to the Controller so that they can be published back in the AWT thread.
- Overrides:
loadViewDatain classSQLLogging- Parameters:
con- database connectionpamViewParameters- viewer parameters.loadObserver-- Returns:
-
deleteData
- Overrides:
deleteDatain classSQLLogging
-
insertCursorRow
protected int insertCursorRow(PamConnection connection, PamCursor pamCursor, PamDataUnit aUnit) throws SQLException Description copied from class:SQLLoggingUsed in standard offline save to add data to a scrollable cursor and adds the cursor row id to the data unit.- Overrides:
insertCursorRowin classSQLLogging- Parameters:
connection-pamCursor-aUnit-- Returns:
- The
- Throws:
SQLException
-
updateCursorRow
protected void updateCursorRow(PamConnection connection, PamCursor pamCursor, PamDataUnit aUnit) throws SQLException Description copied from class:SQLLoggingUsed in standard offline save to update data in a scrollable cursor.- Overrides:
updateCursorRowin classSQLLogging- Parameters:
connection-pamCursor-aUnit-- Throws:
SQLException
-
deleteIndexedItems
Description copied from class:SQLLoggingDelete one or more rows from the database based on their indexes.- Overrides:
deleteIndexedItemsin classSQLLogging- Parameters:
connection-deleteIndexes- list of Id's- Returns:
- true if no exception
-
checkSubTableCount
public int checkSubTableCount(int databaseIndex) Check the number of entries in the sub table which have this database index.- Parameters:
databaseIndex-- Returns:
- number of sub detections.
-
anySubTableItems
find if any sub table items that satisfy a particular clause.- Parameters:
mainTableClause-subTableClause-- Returns:
- true if any items satisfy clause.
-
countSubTableItems
Count the number of sub table items that satisfy a particular clause.- Parameters:
mainTableClause-subTableClause-- Returns:
- count of items.
-
getSubTableClausePolicy
public int getSubTableClausePolicy()- Returns:
- the subTableClausePolicy
- See Also:
-
setSubTableClausePolicy
public void setSubTableClausePolicy(int subTableClausePolicy) - Parameters:
subTableClausePolicy- the subTableClausePolicy to set- See Also:
-
doSubTableUIDRepairs
public void doSubTableUIDRepairs() -
getEventEndTimeItem
- Returns:
- the eventEndTimeItem
-
setEventEndTimeItem
- Parameters:
eventEndTimeItem- the eventEndTimeItem to set
-
isCreateDataUnits
public boolean isCreateDataUnits()- Returns:
- the createDataUnits
-
setCreateDataUnits
public void setCreateDataUnits(boolean createDataUnits) - Parameters:
createDataUnits- the createDataUnits to set
-