Class SYSTRIGGERSRowFactory

java.lang.Object
org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
org.apache.derby.impl.sql.catalog.SYSTRIGGERSRowFactory

public class SYSTRIGGERSRowFactory extends CatalogRowFactory
Factory for creating a SYSTRIGGERS row.
Version:
0.1
  • Field Details

    • TABLENAME_STRING

      static final String TABLENAME_STRING
      See Also:
    • SYSTRIGGERS_TRIGGERID

      public static final int SYSTRIGGERS_TRIGGERID
      See Also:
    • SYSTRIGGERS_TRIGGERNAME

      public static final int SYSTRIGGERS_TRIGGERNAME
      See Also:
    • SYSTRIGGERS_SCHEMAID

      public static final int SYSTRIGGERS_SCHEMAID
      See Also:
    • SYSTRIGGERS_CREATIONTIMESTAMP

      public static final int SYSTRIGGERS_CREATIONTIMESTAMP
      See Also:
    • SYSTRIGGERS_EVENT

      public static final int SYSTRIGGERS_EVENT
      See Also:
    • SYSTRIGGERS_FIRINGTIME

      public static final int SYSTRIGGERS_FIRINGTIME
      See Also:
    • SYSTRIGGERS_TYPE

      public static final int SYSTRIGGERS_TYPE
      See Also:
    • SYSTRIGGERS_STATE

      public static final int SYSTRIGGERS_STATE
      See Also:
    • SYSTRIGGERS_TABLEID

      public static final int SYSTRIGGERS_TABLEID
      See Also:
    • SYSTRIGGERS_WHENSTMTID

      public static final int SYSTRIGGERS_WHENSTMTID
      See Also:
    • SYSTRIGGERS_ACTIONSTMTID

      public static final int SYSTRIGGERS_ACTIONSTMTID
      See Also:
    • SYSTRIGGERS_REFERENCEDCOLUMNS

      public static final int SYSTRIGGERS_REFERENCEDCOLUMNS
      See Also:
    • SYSTRIGGERS_TRIGGERDEFINITION

      public static final int SYSTRIGGERS_TRIGGERDEFINITION
      See Also:
    • SYSTRIGGERS_REFERENCINGOLD

      public static final int SYSTRIGGERS_REFERENCINGOLD
      See Also:
    • SYSTRIGGERS_REFERENCINGNEW

      public static final int SYSTRIGGERS_REFERENCINGNEW
      See Also:
    • SYSTRIGGERS_OLDREFERENCINGNAME

      public static final int SYSTRIGGERS_OLDREFERENCINGNAME
      See Also:
    • SYSTRIGGERS_NEWREFERENCINGNAME

      public static final int SYSTRIGGERS_NEWREFERENCINGNAME
      See Also:
    • SYSTRIGGERS_WHENCLAUSETEXT

      public static final int SYSTRIGGERS_WHENCLAUSETEXT
      See Also:
    • SYSTRIGGERS_COLUMN_COUNT

      public static final int SYSTRIGGERS_COLUMN_COUNT
      See Also:
    • SYSTRIGGERS_INDEX1_ID

      public static final int SYSTRIGGERS_INDEX1_ID
      See Also:
    • SYSTRIGGERS_INDEX2_ID

      public static final int SYSTRIGGERS_INDEX2_ID
      See Also:
    • SYSTRIGGERS_INDEX3_ID

      public static final int SYSTRIGGERS_INDEX3_ID
      See Also:
    • indexColumnPositions

      private static final int[][] indexColumnPositions
    • uniqueness

      private static final boolean[] uniqueness
    • uuids

      private static final String[] uuids
    • UTC

      private static final TimeZone UTC
      TimeZone object representing Coordinated Universal Time.
    • dataDictionary

      private final DataDictionary dataDictionary
  • Constructor Details

  • Method Details

    • makeRow

      public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
      Make a SYSTRIGGERS row.
      Overrides:
      makeRow in class CatalogRowFactory
      Returns:
      Row suitable for inserting into SYSTRIGGERS.
      Throws:
      StandardException - thrown on failure
    • makeEmptyRowForCurrentVersion

      public ExecRow makeEmptyRowForCurrentVersion() throws StandardException
      Description copied from class: CatalogRowFactory

      Create an empty row for this conglomerate, in the format that would be used in a database that was created with, or hard upgraded to, the currently running version. That is, even if the database is only soft-upgraded, this method should return a row in the new format.

      This method is for use in code that creates the catalogs, or that upgrades the format of the catalogs to the newest version. Other code should call CatalogRowFactory.makeEmptyRow(), which returns a row in the format used in the old database version if the database is soft-upgraded.

      Overrides:
      makeEmptyRowForCurrentVersion in class CatalogRowFactory
      Returns:
      an empty row
      Throws:
      StandardException - if an error happens when creating the row
    • makeRow

      private ExecRow makeRow(TupleDescriptor td, int columnCount) throws StandardException
      Helper method that contains common logic for makeRow() and makeEmptyRowForCurrentVersion(). Creates a row for the SYSTRIGGERS conglomerate.
      Parameters:
      td - the TriggerDescriptor to create a row from (can be null if the returned row should be empty)
      columnCount - the number of columns in the returned row (used for trimming off columns in soft upgrade mode to match the format in the old dictionary version)
      Returns:
      a row for the SYSTRIGGERS conglomerate
      Throws:
      StandardException - if an error happens when creating the row
    • getCalendarForCreationTimestamp

      private Calendar getCalendarForCreationTimestamp() throws StandardException
      Get a calendar instance with the correct time zone for storing and retrieving creation timestamps. Creation timestamps are stored in UTC to avoid ambiguities around the change from daylight saving time to standard time, or other time zone changes. If the data dictionary version is less than 10.11, however, the timestamps are stored in the local time zone.
      Returns:
      a calendar instance that can be used for storing and retrieving trigger creation timestamps
      Throws:
      StandardException - if an error occurs
    • buildDescriptor

      public TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd) throws StandardException
      Make an Tuple Descriptor out of a SYSTRIGGERS row
      Specified by:
      buildDescriptor in class CatalogRowFactory
      Parameters:
      row - a SYSTRIGGERS row
      parentTupleDescriptor - unused
      dd - dataDictionary
      Returns:
      a descriptor equivalent to a SYSTRIGGERS row
      Throws:
      StandardException - thrown on failure
    • buildColumnList

      public SystemColumn[] buildColumnList() throws StandardException
      Builds a list of columns suitable for creating this Catalog. The last column, the serialized statement, is not added to the column list. This is done deliberately to make it a 'hidden' column -- one that is not visible to customers, but is visible to the system.
      Specified by:
      buildColumnList in class CatalogRowFactory
      Returns:
      array of SystemColumn suitable for making this catalog.
      Throws:
      StandardException
    • getCharBoolean

      private boolean getCharBoolean(DataValueDescriptor col, char trueValue, char falseValue) throws StandardException
      Throws:
      StandardException
    • getHeapColumnCount

      public int getHeapColumnCount() throws StandardException
      Description copied from class: CatalogRowFactory
      Get the number of columns in the heap.
      Overrides:
      getHeapColumnCount in class CatalogRowFactory
      Returns:
      The number of columns in the heap.
      Throws:
      StandardException