java.lang.Object
com.inductiveautomation.ignition.gateway.storeforward.data.history.BasicHistoricalRecord
All Implemented Interfaces:
PersistentData

public class BasicHistoricalRecord extends Object implements PersistentData
The basic historical record represents a specific query with columns of data. It contains both the data and the table structure, including columns.
  • Field Details

  • Constructor Details

    • BasicHistoricalRecord

      public BasicHistoricalRecord(String tableName, String loggerName)
    • BasicHistoricalRecord

      public BasicHistoricalRecord(BasicHistoricalRecord other)
  • Method Details

    • getFlavor

      @Nonnull public PersistentFlavor<? extends BasicHistoricalRecord> getFlavor()
      Description copied from interface: PersistentData
      Retrieves the PersistentFlavor associated with this kind of persistent data.
      Specified by:
      getFlavor in interface PersistentData
      Returns:
      a PersistentFlavor object
    • getColumns

      public List<HistoricalColumn> getColumns()
    • addColumn

      public void addColumn(HistoricalColumn column)
      Adds a pre-defined column to the row. This allows the caller to provide a custom column type, or use something besides the standard ValueHistoricalColumn.
    • addColumn

      public void addColumn(String name)
      Creates a value column with the given name. Values must be added later with addRow.
    • addColumn

      public void addColumn(String name, QualifiedValue value)
      Adds a column with data to the row. Quickest way to build a single row HistoricalRecord.
    • addRow

      public void addRow(List<Object> rowData)
    • getStructureSignature

      public String getStructureSignature()
      Returns the table structure for the historical record. The expected output string should be "table_name{column_1, column_2, ..., column_x}
      Returns:
      A string representing the table structure for the historical record.
    • getDataCount

      public int getDataCount()
      This returns the number of rows for this historical record.
      Specified by:
      getDataCount in interface PersistentData
      Returns:
      the count of data elements
    • getLoggerName

      public String getLoggerName()
    • getTableName

      public String getTableName()
    • coalesce

      Coalesces the provided BasicHistoricalRecord into this record.
      Parameters:
      other - the record to coalesce
      Returns:
      a new BasicHistoricalRecord representing the combined data of this and the provided record
    • coalesce

      Coalesces the provided list of BasicHistoricalRecord objects into this record.
      Parameters:
      other - the records to coalesce
      Returns:
      a new BasicHistoricalRecord representing the combined data of this and the provided records
    • getQuery

      public String getQuery(DBTranslator translator)
      Returns an SQL INSERT statement for this record, using the provided translator to generate the necessary comma-separated columns.
      Parameters:
      translator - the DBTranslator used to generate the comma-separated columns
      Returns:
      the SQL INSERT statement
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object