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 java.lang.Object
Superclass of all row factories.- Version:
- 0.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
catalogName
private int
columnCount
protected DataValueFactory
dvf
private ExecutionFactory
ef
protected UUID
heapUUID
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
Constructors Constructor Description CatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract SystemColumn[]
buildColumnList()
builds a column list for the catalogabstract TupleDescriptor
buildDescriptor(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary)
builds a tuple descriptor from a rowjava.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 catalogjava.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 ExecutionFactoryint
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.int[]
getIndexColumnPositions(int indexNumber)
Return the column positions for a given index numberjava.lang.String
getIndexName(int indexNum)
Get the name for the specified index number.int
getNumIndexes()
get the number of indexes on this catalogint
getPrimaryKeyIndexNumber()
Get the index number for the primary key index on this catalog.UUIDFactory
getUUIDFactory()
Get the UUID factoryvoid
initInfo(int columnCount, java.lang.String catalogName, int[][] indexColumnPositions, 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
makeEmptyRowForCurrentVersion()
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.ExecRow
makeRow(TupleDescriptor td, TupleDescriptor parent)
most subclasses should provide this method.
-
-
-
Field Detail
-
indexNames
protected java.lang.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 java.lang.String catalogName
-
-
Constructor Detail
-
CatalogRowFactory
public CatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
-
-
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.- 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 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, 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.indexUniqueness
- Uniqueness of the indicesuuidStrings
- 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 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
-
-