Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public abstract Class CatalogRowFactory

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.sql.catalog.SYSCHECKSRowFactory, org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory, org.apache.derby.impl.sql.catalog.PermissionsCatalogRowFactory, org.apache.derby.impl.sql.catalog.SYSALIASESRowFactory, org.apache.derby.impl.sql.catalog.SYSCOLUMNSRowFactory, org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory, org.apache.derby.impl.sql.catalog.SYSCONSTRAINTSRowFactory, org.apache.derby.impl.sql.catalog.SYSDEPENDSRowFactory, org.apache.derby.impl.sql.catalog.SYSDUMMY1RowFactory, org.apache.derby.impl.sql.catalog.SYSFILESRowFactory, org.apache.derby.impl.sql.catalog.SYSFOREIGNKEYSRowFactory, org.apache.derby.impl.sql.catalog.SYSKEYSRowFactory, org.apache.derby.impl.sql.catalog.SYSROLESRowFactory, org.apache.derby.impl.sql.catalog.SYSSCHEMASRowFactory, org.apache.derby.impl.sql.catalog.SYSSEQUENCESRowFactory, org.apache.derby.impl.sql.catalog.SYSSTATISTICSRowFactory, org.apache.derby.impl.sql.catalog.SYSTABLESRowFactory, org.apache.derby.impl.sql.catalog.SYSTRIGGERSRowFactory, org.apache.derby.impl.sql.catalog.SYSUSERSRowFactory, org.apache.derby.impl.sql.catalog.SYSVIEWSRowFactory
Imports
java.util.Properties, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.Property, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.iapi.sql.execute.ExecRow, .ExecutionFactory, org.apache.derby.iapi.store.raw.RawStoreFactory, org.apache.derby.iapi.types.DataValueFactory

Superclass of all row factories.
Version
0.2

Field Summary

Modifier and TypeField and Description
private 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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract SystemColumn[]
buildColumnList()

builds a column list for the catalog

public abstract TupleDescriptor
buildDescriptor(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary)

builds a tuple descriptor from a row

public String

Returns:

the following index name: CatalogName + "_INDEX" + (indexNumber+1)
generateIndexName
(int
Number of index
indexNumber
)

Generate an index name based on the index number.

public String

Returns:

String The name for the heap conglomerate.
getCanonicalHeapName
()

Get the name for the heap conglomerate underlying this catalog.

public UUID

Returns:

the uuid of the heap
getCanonicalHeapUUID
()

Get the UUID of the heap underlying this catalog.

public UUID

Returns:

the uuid of the heap
getCanonicalIndexUUID
(int
The (0-based) index number.
indexNumber
)

Get the UUID of the numbered index.

public UUID

Returns:

the name of this catalog
getCanonicalTableUUID
()

Get the UUID of this catalog.

public String
getCatalogName()

get the name of the catalog

public Properties

Returns:

The Properties associated with creating the heap.
getCreateHeapProperties
()

Get the Properties associated with creating the heap.

public Properties

Returns:

The Properties associated with creating the specified index.
getCreateIndexProperties
(int
The specified index number.
indexNumber
)

Get the Properties associated with creating the specified index.

public DataValueFactory

Returns:

the data value factory for this connection
getDataValueFactory
()

Gets the DataValueFactory for this connection.

public ExecutionFactory

Returns:

an execution factory
getExecutionFactory
()

Gets a ExecutionFactory

public int

Returns:

The number of columns in the heap.
getHeapColumnCount
()

Get the number of columns in the heap.

public int

Returns:

int The number of columns in the index for the specifed index number.
getIndexColumnCount
(int
The (0-based) index number.
indexNum
)

Get the number of columns in the index for the specified index number.

public int[]
getIndexColumnPositions(int indexNumber)

Return the column positions for a given index number

public String

Returns:

String The name for the specified index number.
getIndexName
(int
The (0-based) index number.
indexNum
)

Get the name for the specified index number.

public int
getNumIndexes()

get the number of indexes on this catalog

public int

Returns:

a 0-based number
getPrimaryKeyIndexNumber
()

Get the index number for the primary key index on this catalog.

public UUIDFactory

Returns:

the UUID factory
getUUIDFactory
()

Get the UUID factory

public void
initInfo(int
number of columns in the base table.
columnCount
,
String
name of the catalog (the case might have to be converted).
catalogName
,
int[][]
2 dim array of ints specifying the base column positions for each index.
indexColumnPositions
,
boolean[]
Uniqueness of the indices
indexUniqueness
,
String[]
Array of stringified UUIDs for table and its conglomerates
uuidStrings
)

Initialize info, including array of index names and array of index column counts.

public boolean

Returns:

boolean Whether or not the specified index is unique.
isIndexUnique
(int
The (0-based) index number.
indexNumber
)

Return whether or not the specified index is unique.

public ExecRow
makeEmptyRow()

Return an empty row for this conglomerate.

public ExecRow

Returns:

an empty row
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.

public ExecRow
makeRow(TupleDescriptor td, TupleDescriptor parent)

most subclasses should provide this method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

catalogNameback to summary
private String catalogName
columnCountback to summary
private int columnCount
dvfback to summary
protected DataValueFactory dvf
efback to summary
private final ExecutionFactory ef
heapUUIDback to summary
protected UUID heapUUID
indexColumnPositionsback to summary
protected int[][] indexColumnPositions
indexCountback to summary
private int indexCount
indexNamesback to summary
protected String[] indexNames
indexUniquenessback to summary
protected boolean[] indexUniqueness
indexUUIDback to summary
protected UUID[] indexUUID
tableUUIDback to summary
protected UUID tableUUID
uuidfback to summary
private UUIDFactory uuidf

Constructor Detail

CatalogRowFactoryback to summary
public CatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)

Method Detail

buildColumnListback to summary
public abstract SystemColumn[] buildColumnList() throws StandardException

builds a column list for the catalog

buildDescriptorback to summary
public abstract TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTuple, DataDictionary dataDictionary) throws StandardException

builds a tuple descriptor from a row

generateIndexNameback to summary
public String generateIndexName(int indexNumber)

Generate an index name based on the index number.

Parameters
indexNumber:int

Number of index

Returns:String

the following index name: CatalogName + "_INDEX" + (indexNumber+1)

getCanonicalHeapNameback to summary
public String getCanonicalHeapName()

Get the name for the heap conglomerate underlying this catalog. See getCanonicalTableUUID() for a description of canonical uuids.

Returns:String

String The name for the heap conglomerate.

getCanonicalHeapUUIDback to summary
public UUID getCanonicalHeapUUID()

Get the UUID of the heap underlying this catalog. See getCanonicalTableUUID() for a description of canonical uuids.

Returns:UUID

the uuid of the heap

getCanonicalIndexUUIDback to summary
public UUID getCanonicalIndexUUID(int indexNumber)

Get the UUID of the numbered index. See getCanonicalTableUUID() for a description of canonical uuids.

Parameters
indexNumber:int

The (0-based) index number.

Returns:UUID

the uuid of the heap

getCanonicalTableUUIDback to summary
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:UUID

the name of this catalog

getCatalogNameback to summary
public String getCatalogName()

get the name of the catalog

getCreateHeapPropertiesback to summary
public Properties getCreateHeapProperties()

Get the Properties associated with creating the heap.

Returns:Properties

The Properties associated with creating the heap.

getCreateIndexPropertiesback to summary
public Properties getCreateIndexProperties(int indexNumber)

Get the Properties associated with creating the specified index.

Parameters
indexNumber:int

The specified index number.

Returns:Properties

The Properties associated with creating the specified index.

getDataValueFactoryback to summary
public DataValueFactory getDataValueFactory()

Gets the DataValueFactory for this connection.

Returns:DataValueFactory

the data value factory for this connection

getExecutionFactoryback to summary
public ExecutionFactory getExecutionFactory()

Gets a ExecutionFactory

Returns:ExecutionFactory

an execution factory

getHeapColumnCountback to summary
public int getHeapColumnCount() throws StandardException

Get the number of columns in the heap.

Returns:int

The number of columns in the heap.

getIndexColumnCountback to summary
public int getIndexColumnCount(int indexNum)

Get the number of columns in the index for the specified index number.

Parameters
indexNum:int

The (0-based) index number.

Returns:int

int The number of columns in the index for the specifed index number.

getIndexColumnPositionsback to summary
public int[] getIndexColumnPositions(int indexNumber)

Return the column positions for a given index number

getIndexNameback to summary
public String getIndexName(int indexNum)

Get the name for the specified index number.

Parameters
indexNum:int

The (0-based) index number.

Returns:String

String The name for the specified index number.

getNumIndexesback to summary
public int getNumIndexes()

get the number of indexes on this catalog

getPrimaryKeyIndexNumberback to summary
public int getPrimaryKeyIndexNumber()

Get the index number for the primary key index on this catalog.

Returns:int

a 0-based number

getUUIDFactoryback to summary
public UUIDFactory getUUIDFactory()

Get the UUID factory

Returns:UUIDFactory

the UUID factory

initInfoback to summary
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:int

number of columns in the base table.

catalogName:String

name of the catalog (the case might have to be converted).

indexColumnPositions:int[][]

2 dim array of ints specifying the base column positions for each index.

indexUniqueness:boolean[]

Uniqueness of the indices

uuidStrings:String[]

Array of stringified UUIDs for table and its conglomerates

isIndexUniqueback to summary
public boolean isIndexUnique(int indexNumber)

Return whether or not the specified index is unique.

Parameters
indexNumber:int

The (0-based) index number.

Returns:boolean

boolean Whether or not the specified index is unique.

makeEmptyRowback to summary
public ExecRow makeEmptyRow() throws StandardException

Return an empty row for this conglomerate.

makeEmptyRowForCurrentVersionback to summary
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:ExecRow

an empty row

Exceptions
StandardException:
if an error happens when creating the row
makeRowback to summary
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.