org.apache.derby.iapi.sql.dictionary
Class CatalogRowFactory

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

public abstract class CatalogRowFactory
extends java.lang.Object

Superclass of all row factories.

Version:
0.2
Author:
Rick Hillegas, Manish Khettry

Field Summary
private  java.lang.String catalogName
           
private  int columnCount
           
private  boolean convertIdToLower
           
protected  DataValueFactory dvf
           
private  ExecutionFactory ef
           
protected  UUID heapUUID
           
protected  java.lang.String[][] indexColumnNames
           
protected  int[][] indexColumnPositions
           
private  int indexCount
           
protected  java.lang.String[] indexNames
           
protected  boolean[] indexUniqueness
           
protected  UUID[] indexUUID
           
protected  UUID tableUUID
           
private  UUIDFactory uuidf
           
 
Constructor Summary
CatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf, boolean convertIdToLower)
           
 
Method Summary
abstract  SystemColumn[] buildColumnList()
          builds a column list for the catalog
abstract  TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary)
          builds a tuple descriptor from a row
abstract  ExecIndexRow buildEmptyIndexRow(int indexNumber, RowLocation rowLocation)
          builds an empty row given for a given index number.
protected  void checkIndexNumber(int indexNumber)
           
protected  java.lang.String convertIdCase(java.lang.String id)
           
 java.lang.String generateIndexName(int indexNumber)
          Generate an index name based on the index number.
 java.lang.String getCanonicalHeapName()
          Get the name for the heap conglomerate underlying this catalog.
 UUID getCanonicalHeapUUID()
          Get the UUID of the heap underlying this catalog.
 UUID getCanonicalIndexUUID(int indexNumber)
          Get the UUID of the numbered index.
 UUID getCanonicalTableUUID()
          Get the UUID of this catalog.
 java.lang.String getCatalogName()
          get the name of the catalog
 java.util.Properties getCreateHeapProperties()
          Get the Properties associated with creating the heap.
 java.util.Properties getCreateIndexProperties(int indexNumber)
          Get the Properties associated with creating the specified index.
 DataValueFactory getDataValueFactory()
          Gets the DataValueFactory for this connection.
 ExecutionFactory getExecutionFactory()
          Gets a ExecutionFactory
 int getHeapColumnCount()
          Get the number of columns in the heap.
 int getIndexColumnCount(int indexNum)
          Get the number of columns in the index for the specified index number.
 java.lang.String[] getIndexColumnNames(int indexNumber)
          Return the names of columns for a given index number
 int[] getIndexColumnPositions(int indexNumber)
          Return the column positions for a given index number
 java.lang.String getIndexName(int indexNum)
          Get the name for the specified index number.
 int getNumIndexes()
          get the number of indexes on this catalog
 int getPrimaryKeyIndexNumber()
          Get the index number for the primary key index on this catalog.
 UUIDFactory getUUIDFactory()
          Get the UUID factory
 void initInfo(int columnCount, java.lang.String catalogName, int[][] indexColumnPositions, java.lang.String[][] indexColumnNames, boolean[] indexUniqueness, java.lang.String[] uuidStrings)
          Initialize info, including array of index names and array of index column counts.
 boolean isIndexUnique(int indexNumber)
          Return whether or not the specified index is unique.
 ExecRow makeEmptyRow()
          Return an empty row for this conglomerate.
 ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent)
          most subclasses should provide this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexNames

protected java.lang.String[] indexNames

indexColumnPositions

protected int[][] indexColumnPositions

indexColumnNames

protected java.lang.String[][] indexColumnNames

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

convertIdToLower

private boolean convertIdToLower

indexCount

private int indexCount

columnCount

private int columnCount

catalogName

private java.lang.String catalogName
Constructor Detail

CatalogRowFactory

public CatalogRowFactory(UUIDFactory uuidf,
                         ExecutionFactory ef,
                         DataValueFactory dvf,
                         boolean convertIdToLower)
Method Detail

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 java.lang.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 java.lang.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.

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 java.lang.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 java.lang.String getCatalogName()
get the name of the catalog


initInfo

public void initInfo(int columnCount,
                     java.lang.String catalogName,
                     int[][] indexColumnPositions,
                     java.lang.String[][] indexColumnNames,
                     boolean[] indexUniqueness,
                     java.lang.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.
indexColumnNames - 2 dim array of Strings specifying the name of the base column for each index.
indexUniqueness - Uniqueness of the indices
uuidStrings - Array of stringified UUIDs for table and its conglomerates

getCreateHeapProperties

public java.util.Properties getCreateHeapProperties()
Get the Properties associated with creating the heap.

Returns:
The Properties associated with creating the heap.

getCreateIndexProperties

public java.util.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 final int getHeapColumnCount()
Get the number of columns in the heap.

Returns:
The number of columns in the heap.

convertIdCase

protected java.lang.String convertIdCase(java.lang.String id)

makeEmptyRow

public ExecRow makeEmptyRow()
                     throws StandardException
Return an empty row for this conglomerate.

Throws:
StandardException

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()
builds a column list for the catalog


buildEmptyIndexRow

public abstract ExecIndexRow buildEmptyIndexRow(int indexNumber,
                                                RowLocation rowLocation)
                                         throws StandardException
builds an empty row given for a given index number.

Throws:
StandardException

getIndexColumnPositions

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


getIndexColumnNames

public java.lang.String[] getIndexColumnNames(int indexNumber)
Return the names of columns for a given index number


checkIndexNumber

protected void checkIndexNumber(int indexNumber)


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.