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
Superclass of all row factories.
- Version:
- 0.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private int
protected DataValueFactory
private final ExecutionFactory
protected UUID
protected int[][]
private int
protected String[]
protected boolean[]
protected UUID[]
protected UUID
private UUIDFactory
-
Constructor Summary
ConstructorsConstructorDescriptionCatalogRowFactory
(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf) -
Method Summary
Modifier and TypeMethodDescriptionabstract SystemColumn[]
builds a column list for the catalogabstract TupleDescriptor
buildDescriptor
(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary) builds a tuple descriptor from a rowgenerateIndexName
(int indexNumber) Generate an index name based on the index number.Get the name for the heap conglomerate underlying this catalog.Get the UUID of the heap underlying this catalog.getCanonicalIndexUUID
(int indexNumber) Get the UUID of the numbered index.Get the UUID of this catalog.get the name of the catalogGet the Properties associated with creating the heap.getCreateIndexProperties
(int indexNumber) Get the Properties associated with creating the specified index.Gets the DataValueFactory for this connection.Gets a ExecutionFactoryint
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 numbergetIndexName
(int indexNum) Get the name for the specified index number.int
get the number of indexes on this catalogint
Get the index number for the primary key index on this catalog.Get the UUID factoryvoid
initInfo
(int columnCount, String catalogName, int[][] indexColumnPositions, boolean[] indexUniqueness, 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.Return an empty row for this conglomerate.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.makeRow
(TupleDescriptor td, TupleDescriptor parent) most subclasses should provide this method.
-
Field Details
-
indexNames
-
indexColumnPositions
protected int[][] indexColumnPositions -
indexUniqueness
protected boolean[] indexUniqueness -
tableUUID
-
heapUUID
-
indexUUID
-
dvf
-
ef
-
uuidf
-
indexCount
private int indexCount -
columnCount
private int columnCount -
catalogName
-
-
Constructor Details
-
CatalogRowFactory
-
-
Method Details
-
getExecutionFactory
Gets a ExecutionFactory- Returns:
- an execution factory
-
getUUIDFactory
Get the UUID factory- Returns:
- the UUID factory
-
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
Get the UUID of the heap underlying this catalog. See getCanonicalTableUUID() for a description of canonical uuids.- Returns:
- the uuid of the heap
-
getCanonicalIndexUUID
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
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
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
Gets the DataValueFactory for this connection.- Returns:
- the data value factory for this connection
-
generateIndexName
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
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 indicesuuidStrings
- Array of stringified UUIDs for table and its conglomerates
-
getCreateHeapProperties
Get the Properties associated with creating the heap.- Returns:
- The Properties associated with creating the heap.
-
getCreateIndexProperties
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
Get the number of columns in the heap.- Returns:
- The number of columns in the heap.
- Throws:
StandardException
-
makeEmptyRow
Return an empty row for this conglomerate.- Throws:
StandardException
-
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. 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
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
builds a column list for the catalog- Throws:
StandardException
-
getIndexColumnPositions
public int[] getIndexColumnPositions(int indexNumber) Return the column positions for a given index number
-