Top Description Fields Constructors Methods
org.apache.derby.impl.sql.catalog

public Class SYSTRIGGERSRowFactory

extends CatalogRowFactory
Class Inheritance
Imports
org.apache.derby.iapi.types.DataValueDescriptor, .SQLBoolean, .SQLChar, .SQLVarchar, .UserType, .DataValueFactory, .SQLTimestamp, org.apache.derby.iapi.sql.dictionary.CatalogRowFactory, .DataDescriptorGenerator, .DataDictionary, .SystemColumn, .TriggerDescriptor, .TupleDescriptor, org.apache.derby.iapi.sql.execute.ExecRow, .ExecutionFactory, org.apache.derby.shared.common.error.StandardException, org.apache.derby.catalog.ReferencedColumns, .UUID, org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl, org.apache.derby.iapi.services.uuid.UUIDFactory, org.apache.derby.shared.common.sanity.SanityManager, java.sql.Timestamp, .Types, java.util.Calendar, .TimeZone

Factory for creating a SYSTRIGGERS row.
Version
0.1

Field Summary

Modifier and TypeField and Description
private final DataDictionary
private static final int[][]
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
pack-priv static final String
private static final boolean[]
private static final TimeZone
UTC

TimeZone object representing Coordinated Universal Time.

private static final String[]
Inherited from org.apache.derby.iapi.sql.dictionary.CatalogRowFactory:
dvfheapUUIDindexNamesindexUniquenessindexUUIDtableUUID

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public SystemColumn[]

Returns:

array of SystemColumn suitable for making this catalog.
buildColumnList
()

Implements abstract org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.buildColumnList.

Builds a list of columns suitable for creating this Catalog.

public TupleDescriptor

Returns:

a descriptor equivalent to a SYSTRIGGERS row
buildDescriptor
(ExecRow
a SYSTRIGGERS row
row
,
TupleDescriptor
unused
parentTupleDescriptor
,
DataDictionary
dataDictionary
dd
)

Implements abstract org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.buildDescriptor.

Make an Tuple Descriptor out of a SYSTRIGGERS row

private Calendar

Returns:

a calendar instance that can be used for storing and retrieving trigger creation timestamps
getCalendarForCreationTimestamp
()

Get a calendar instance with the correct time zone for storing and retrieving creation timestamps.

private boolean
getCharBoolean(DataValueDescriptor col, char trueValue, char falseValue)

public int
public ExecRow
makeEmptyRowForCurrentVersion()

Overrides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.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

Returns:

Row suitable for inserting into SYSTRIGGERS.
makeRow
(TupleDescriptor td, TupleDescriptor parent)

Overrides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.makeRow.

Make a SYSTRIGGERS row.

private ExecRow

Returns:

a row for the SYSTRIGGERS conglomerate
makeRow
(TupleDescriptor
the TriggerDescriptor to create a row from (can be null if the returned row should be empty)
td
,
int
the number of columns in the returned row (used for trimming off columns in soft upgrade mode to match the format in the old dictionary version)
columnCount
)

Helper method that contains common logic for makeRow() and makeEmptyRowForCurrentVersion().

Inherited from org.apache.derby.iapi.sql.dictionary.CatalogRowFactory:
generateIndexNamegetCanonicalHeapNamegetCanonicalHeapUUIDgetCanonicalIndexUUIDgetCanonicalTableUUIDgetCatalogNamegetCreateHeapPropertiesgetCreateIndexPropertiesgetDataValueFactorygetExecutionFactorygetIndexColumnCountgetIndexColumnPositionsgetIndexNamegetNumIndexesgetPrimaryKeyIndexNumbergetUUIDFactoryinitInfoisIndexUniquemakeEmptyRow

Field Detail

dataDictionaryback to summary
private final DataDictionary dataDictionary
indexColumnPositionsback to summary
private static final int[][] indexColumnPositions

Hides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.indexColumnPositions.

SYSTRIGGERS_ACTIONSTMTIDback to summary
public static final int SYSTRIGGERS_ACTIONSTMTID
SYSTRIGGERS_COLUMN_COUNTback to summary
public static final int SYSTRIGGERS_COLUMN_COUNT
SYSTRIGGERS_CREATIONTIMESTAMPback to summary
public static final int SYSTRIGGERS_CREATIONTIMESTAMP
SYSTRIGGERS_EVENTback to summary
public static final int SYSTRIGGERS_EVENT
SYSTRIGGERS_FIRINGTIMEback to summary
public static final int SYSTRIGGERS_FIRINGTIME
SYSTRIGGERS_INDEX1_IDback to summary
public static final int SYSTRIGGERS_INDEX1_ID
SYSTRIGGERS_INDEX2_IDback to summary
public static final int SYSTRIGGERS_INDEX2_ID
SYSTRIGGERS_INDEX3_IDback to summary
public static final int SYSTRIGGERS_INDEX3_ID
SYSTRIGGERS_NEWREFERENCINGNAMEback to summary
public static final int SYSTRIGGERS_NEWREFERENCINGNAME
SYSTRIGGERS_OLDREFERENCINGNAMEback to summary
public static final int SYSTRIGGERS_OLDREFERENCINGNAME
SYSTRIGGERS_REFERENCEDCOLUMNSback to summary
public static final int SYSTRIGGERS_REFERENCEDCOLUMNS
SYSTRIGGERS_REFERENCINGNEWback to summary
public static final int SYSTRIGGERS_REFERENCINGNEW
SYSTRIGGERS_REFERENCINGOLDback to summary
public static final int SYSTRIGGERS_REFERENCINGOLD
SYSTRIGGERS_SCHEMAIDback to summary
public static final int SYSTRIGGERS_SCHEMAID
SYSTRIGGERS_STATEback to summary
public static final int SYSTRIGGERS_STATE
SYSTRIGGERS_TABLEIDback to summary
public static final int SYSTRIGGERS_TABLEID
SYSTRIGGERS_TRIGGERDEFINITIONback to summary
public static final int SYSTRIGGERS_TRIGGERDEFINITION
SYSTRIGGERS_TRIGGERIDback to summary
public static final int SYSTRIGGERS_TRIGGERID
SYSTRIGGERS_TRIGGERNAMEback to summary
public static final int SYSTRIGGERS_TRIGGERNAME
SYSTRIGGERS_TYPEback to summary
public static final int SYSTRIGGERS_TYPE
SYSTRIGGERS_WHENCLAUSETEXTback to summary
public static final int SYSTRIGGERS_WHENCLAUSETEXT
SYSTRIGGERS_WHENSTMTIDback to summary
public static final int SYSTRIGGERS_WHENSTMTID
TABLENAME_STRINGback to summary
pack-priv static final String TABLENAME_STRING
uniquenessback to summary
private static final boolean[] uniqueness
UTCback to summary
private static final TimeZone UTC

TimeZone object representing Coordinated Universal Time.

uuidsback to summary
private static final String[] uuids

Constructor Detail

SYSTRIGGERSRowFactoryback to summary
pack-priv SYSTRIGGERSRowFactory(DataDictionary dd, UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf) throws StandardException

Method Detail

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

Implements abstract org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.buildColumnList.

Builds a list of columns suitable for creating this Catalog. The last column, the serialized statement, is not added to the column list. This is done deliberately to make it a 'hidden' column -- one that is not visible to customers, but is visible to the system.

Returns:SystemColumn[]

array of SystemColumn suitable for making this catalog.

buildDescriptorback to summary
public TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd) throws StandardException

Implements abstract org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.buildDescriptor.

Make an Tuple Descriptor out of a SYSTRIGGERS row

Parameters
row:ExecRow

a SYSTRIGGERS row

parentTupleDescriptor:TupleDescriptor

unused

dd:DataDictionary

dataDictionary

Returns:TupleDescriptor

a descriptor equivalent to a SYSTRIGGERS row

Exceptions
StandardException:
thrown on failure
getCalendarForCreationTimestampback to summary
private Calendar getCalendarForCreationTimestamp() throws StandardException

Get a calendar instance with the correct time zone for storing and retrieving creation timestamps. Creation timestamps are stored in UTC to avoid ambiguities around the change from daylight saving time to standard time, or other time zone changes. If the data dictionary version is less than 10.11, however, the timestamps are stored in the local time zone.

Returns:Calendar

a calendar instance that can be used for storing and retrieving trigger creation timestamps

Exceptions
StandardException:
if an error occurs
getCharBooleanback to summary
private boolean getCharBoolean(DataValueDescriptor col, char trueValue, char falseValue) throws StandardException
getHeapColumnCountback to summary
public int getHeapColumnCount() throws StandardException

Overrides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.getHeapColumnCount.

Doc from org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.getHeapColumnCount.

Get the number of columns in the heap.

Returns:int

The number of columns in the heap.

Annotations
@Override
makeEmptyRowForCurrentVersionback to summary
public ExecRow makeEmptyRowForCurrentVersion() throws StandardException

Overrides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.makeEmptyRowForCurrentVersion.

Doc from org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.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:ExecRow

an empty row

Annotations
@Override
Exceptions
StandardException:
if an error happens when creating the row
makeRowback to summary
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException

Overrides org.apache.derby.iapi.sql.dictionary.CatalogRowFactory.makeRow.

Make a SYSTRIGGERS row.

Returns:ExecRow

Row suitable for inserting into SYSTRIGGERS.

Annotations
@Override
Exceptions
StandardException:
thrown on failure
makeRowback to summary
private ExecRow makeRow(TupleDescriptor td, int columnCount) throws StandardException

Helper method that contains common logic for makeRow() and makeEmptyRowForCurrentVersion(). Creates a row for the SYSTRIGGERS conglomerate.

Parameters
td:TupleDescriptor

the TriggerDescriptor to create a row from (can be null if the returned row should be empty)

columnCount:int

the number of columns in the returned row (used for trimming off columns in soft upgrade mode to match the format in the old dictionary version)

Returns:ExecRow

a row for the SYSTRIGGERS conglomerate

Exceptions
StandardException:
if an error happens when creating the row