Class CatalogRowFactory

java.lang.Object
org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
Direct Known Subclasses:
PermissionsCatalogRowFactory, SYSALIASESRowFactory, SYSCHECKSRowFactory, SYSCOLUMNSRowFactory, SYSCONGLOMERATESRowFactory, SYSCONSTRAINTSRowFactory, SYSDEPENDSRowFactory, SYSDUMMY1RowFactory, SYSFILESRowFactory, SYSFOREIGNKEYSRowFactory, SYSKEYSRowFactory, SYSROLESRowFactory, SYSSCHEMASRowFactory, SYSSEQUENCESRowFactory, SYSSTATEMENTSRowFactory, SYSSTATISTICSRowFactory, SYSTABLESRowFactory, SYSTRIGGERSRowFactory, SYSUSERSRowFactory, SYSVIEWSRowFactory

public abstract class CatalogRowFactory extends Object
Superclass of all row factories.
Version:
0.2
  • Field Details

    • indexNames

      protected String[] indexNames
    • indexColumnPositions

      protected int[][] indexColumnPositions
    • indexUniqueness

      protected boolean[] indexUniqueness
    • tableUUID

      protected UUID tableUUID
    • heapUUID

      protected UUID heapUUID
    • indexUUID

      protected UUID[] indexUUID
    • dvf

      protected DataValueFactory dvf
    • ef

      private final ExecutionFactory ef
    • uuidf

      private UUIDFactory uuidf
    • indexCount

      private int indexCount
    • columnCount

      private int columnCount
    • catalogName

      private String catalogName
  • Constructor Details

  • Method Details

    • getExecutionFactory

      public ExecutionFactory getExecutionFactory()
      Gets a ExecutionFactory
      Returns:
      an execution factory
    • getUUIDFactory

      public UUIDFactory getUUIDFactory()
      Get the UUID factory
      Returns:
      the UUID factory
    • getCanonicalTableUUID

      public UUID getCanonicalTableUUID()
      Get the UUID of this catalog. This is the hard-coded uuid for this catalog that is generated for releases starting with Plato (1.3). Earlier releases generated their own UUIDs for system objectss on the fly.
      Returns:
      the name of this catalog
    • getCanonicalHeapUUID

      public UUID getCanonicalHeapUUID()
      Get the UUID of the heap underlying this catalog. See getCanonicalTableUUID() for a description of canonical uuids.
      Returns:
      the uuid of the heap
    • getCanonicalIndexUUID

      public UUID getCanonicalIndexUUID(int indexNumber)
      Get the UUID of the numbered index. See getCanonicalTableUUID() for a description of canonical uuids.
      Parameters:
      indexNumber - The (0-based) index number.
      Returns:
      the uuid of the heap
    • getIndexColumnCount

      public int getIndexColumnCount(int indexNum)
      Get the number of columns in the index for the specified index number.
      Parameters:
      indexNum - The (0-based) index number.
      Returns:
      int The number of columns in the index for the specifed index number.
    • getCanonicalHeapName

      public String getCanonicalHeapName()
      Get the name for the heap conglomerate underlying this catalog. See getCanonicalTableUUID() for a description of canonical uuids.
      Returns:
      String The name for the heap conglomerate.
    • getIndexName

      public String getIndexName(int indexNum)
      Get the name for the specified index number.
      Parameters:
      indexNum - The (0-based) index number.
      Returns:
      String The name for the specified index number.
    • isIndexUnique

      public boolean isIndexUnique(int indexNumber)
      Return whether or not the specified index is unique.
      Parameters:
      indexNumber - The (0-based) index number.
      Returns:
      boolean Whether or not the specified index is unique.
    • getDataValueFactory

      public DataValueFactory getDataValueFactory()
      Gets the DataValueFactory for this connection.
      Returns:
      the data value factory for this connection
    • generateIndexName

      public String generateIndexName(int indexNumber)
      Generate an index name based on the index number.
      Parameters:
      indexNumber - Number of index
      Returns:
      the following index name: CatalogName + "_INDEX" + (indexNumber+1)
    • getNumIndexes

      public int getNumIndexes()
      get the number of indexes on this catalog
    • getCatalogName

      public String getCatalogName()
      get the name of the catalog
    • initInfo

      public void initInfo(int columnCount, String catalogName, int[][] indexColumnPositions, boolean[] indexUniqueness, String[] uuidStrings)
      Initialize info, including array of index names and array of index column counts. Called at constructor time.
      Parameters:
      columnCount - number of columns in the base table.
      catalogName - name of the catalog (the case might have to be converted).
      indexColumnPositions - 2 dim array of ints specifying the base column positions for each index.
      indexUniqueness - Uniqueness of the indices
      uuidStrings - Array of stringified UUIDs for table and its conglomerates
    • getCreateHeapProperties

      public Properties getCreateHeapProperties()
      Get the Properties associated with creating the heap.
      Returns:
      The Properties associated with creating the heap.
    • getCreateIndexProperties

      public Properties getCreateIndexProperties(int indexNumber)
      Get the Properties associated with creating the specified index.
      Parameters:
      indexNumber - The specified index number.
      Returns:
      The Properties associated with creating the specified index.
    • getPrimaryKeyIndexNumber

      public int getPrimaryKeyIndexNumber()
      Get the index number for the primary key index on this catalog.
      Returns:
      a 0-based number
    • getHeapColumnCount

      public int getHeapColumnCount() throws StandardException
      Get the number of columns in the heap.
      Returns:
      The number of columns in the heap.
      Throws:
      StandardException
    • makeEmptyRow

      public ExecRow makeEmptyRow() throws StandardException
      Return an empty row for this conglomerate.
      Throws:
      StandardException
    • makeEmptyRowForCurrentVersion

      public ExecRow makeEmptyRowForCurrentVersion() throws StandardException

      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 makeEmptyRow(), which returns a row in the format used in the old database version if the database is soft-upgraded.

      Returns:
      an empty row
      Throws:
      StandardException - if an error happens when creating the row
    • makeRow

      public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
      most subclasses should provide this method. One or two oddball cases in Replication and SysSTATEMENTSRowFactory don't. For those we call makeRow with the additional arguments.
      Throws:
      StandardException
    • buildDescriptor

      public abstract TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary) throws StandardException
      builds a tuple descriptor from a row
      Throws:
      StandardException
    • buildColumnList

      public abstract SystemColumn[] buildColumnList() throws StandardException
      builds a column list for the catalog
      Throws:
      StandardException
    • getIndexColumnPositions

      public int[] getIndexColumnPositions(int indexNumber)
      Return the column positions for a given index number