Class SYSTRIGGERSRowFactory
java.lang.Object
org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
org.apache.derby.impl.sql.catalog.SYSTRIGGERSRowFactory
Factory for creating a SYSTRIGGERS row.
- Version:
- 0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DataDictionary
private static final int[][]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
(package private) static final String
private static final boolean[]
private static final TimeZone
TimeZone object representing Coordinated Universal Time.private static final String[]
Fields inherited from class org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
dvf, heapUUID, indexNames, indexUniqueness, indexUUID, tableUUID
-
Constructor Summary
ConstructorsConstructorDescriptionSYSTRIGGERSRowFactory
(DataDictionary dd, UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf) -
Method Summary
Modifier and TypeMethodDescriptionBuilds a list of columns suitable for creating this Catalog.buildDescriptor
(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd) Make an Tuple Descriptor out of a SYSTRIGGERS rowprivate Calendar
Get a calendar instance with the correct time zone for storing and retrieving creation timestamps.private boolean
getCharBoolean
(DataValueDescriptor col, char trueValue, char falseValue) int
Get the number of columns in the heap.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.private ExecRow
makeRow
(TupleDescriptor td, int columnCount) Helper method that contains common logic formakeRow()
andmakeEmptyRowForCurrentVersion()
.makeRow
(TupleDescriptor td, TupleDescriptor parent) Make a SYSTRIGGERS row.Methods inherited from class org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
generateIndexName, getCanonicalHeapName, getCanonicalHeapUUID, getCanonicalIndexUUID, getCanonicalTableUUID, getCatalogName, getCreateHeapProperties, getCreateIndexProperties, getDataValueFactory, getExecutionFactory, getIndexColumnCount, getIndexColumnPositions, getIndexName, getNumIndexes, getPrimaryKeyIndexNumber, getUUIDFactory, initInfo, isIndexUnique, makeEmptyRow
-
Field Details
-
TABLENAME_STRING
- See Also:
-
SYSTRIGGERS_TRIGGERID
public static final int SYSTRIGGERS_TRIGGERID- See Also:
-
SYSTRIGGERS_TRIGGERNAME
public static final int SYSTRIGGERS_TRIGGERNAME- See Also:
-
SYSTRIGGERS_SCHEMAID
public static final int SYSTRIGGERS_SCHEMAID- See Also:
-
SYSTRIGGERS_CREATIONTIMESTAMP
public static final int SYSTRIGGERS_CREATIONTIMESTAMP- See Also:
-
SYSTRIGGERS_EVENT
public static final int SYSTRIGGERS_EVENT- See Also:
-
SYSTRIGGERS_FIRINGTIME
public static final int SYSTRIGGERS_FIRINGTIME- See Also:
-
SYSTRIGGERS_TYPE
public static final int SYSTRIGGERS_TYPE- See Also:
-
SYSTRIGGERS_STATE
public static final int SYSTRIGGERS_STATE- See Also:
-
SYSTRIGGERS_TABLEID
public static final int SYSTRIGGERS_TABLEID- See Also:
-
SYSTRIGGERS_WHENSTMTID
public static final int SYSTRIGGERS_WHENSTMTID- See Also:
-
SYSTRIGGERS_ACTIONSTMTID
public static final int SYSTRIGGERS_ACTIONSTMTID- See Also:
-
SYSTRIGGERS_REFERENCEDCOLUMNS
public static final int SYSTRIGGERS_REFERENCEDCOLUMNS- See Also:
-
SYSTRIGGERS_TRIGGERDEFINITION
public static final int SYSTRIGGERS_TRIGGERDEFINITION- See Also:
-
SYSTRIGGERS_REFERENCINGOLD
public static final int SYSTRIGGERS_REFERENCINGOLD- See Also:
-
SYSTRIGGERS_REFERENCINGNEW
public static final int SYSTRIGGERS_REFERENCINGNEW- See Also:
-
SYSTRIGGERS_OLDREFERENCINGNAME
public static final int SYSTRIGGERS_OLDREFERENCINGNAME- See Also:
-
SYSTRIGGERS_NEWREFERENCINGNAME
public static final int SYSTRIGGERS_NEWREFERENCINGNAME- See Also:
-
SYSTRIGGERS_WHENCLAUSETEXT
public static final int SYSTRIGGERS_WHENCLAUSETEXT- See Also:
-
SYSTRIGGERS_COLUMN_COUNT
public static final int SYSTRIGGERS_COLUMN_COUNT- See Also:
-
SYSTRIGGERS_INDEX1_ID
public static final int SYSTRIGGERS_INDEX1_ID- See Also:
-
SYSTRIGGERS_INDEX2_ID
public static final int SYSTRIGGERS_INDEX2_ID- See Also:
-
SYSTRIGGERS_INDEX3_ID
public static final int SYSTRIGGERS_INDEX3_ID- See Also:
-
indexColumnPositions
private static final int[][] indexColumnPositions -
uniqueness
private static final boolean[] uniqueness -
uuids
-
UTC
TimeZone object representing Coordinated Universal Time. -
dataDictionary
-
-
Constructor Details
-
SYSTRIGGERSRowFactory
SYSTRIGGERSRowFactory(DataDictionary dd, UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf) throws StandardException - Throws:
StandardException
-
-
Method Details
-
makeRow
Make a SYSTRIGGERS row.- Overrides:
makeRow
in classCatalogRowFactory
- Returns:
- Row suitable for inserting into SYSTRIGGERS.
- Throws:
StandardException
- thrown on failure
-
makeEmptyRowForCurrentVersion
Description copied from class:CatalogRowFactory
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
CatalogRowFactory.makeEmptyRow()
, which returns a row in the format used in the old database version if the database is soft-upgraded.- Overrides:
makeEmptyRowForCurrentVersion
in classCatalogRowFactory
- Returns:
- an empty row
- Throws:
StandardException
- if an error happens when creating the row
-
makeRow
Helper method that contains common logic formakeRow()
andmakeEmptyRowForCurrentVersion()
. Creates a row for the SYSTRIGGERS conglomerate.- Parameters:
td
- theTriggerDescriptor
to create a row from (can benull
if the returned row should be empty)columnCount
- 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:
- a row for the SYSTRIGGERS conglomerate
- Throws:
StandardException
- if an error happens when creating the row
-
getCalendarForCreationTimestamp
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:
- a calendar instance that can be used for storing and retrieving trigger creation timestamps
- Throws:
StandardException
- if an error occurs
-
buildDescriptor
public TupleDescriptor buildDescriptor(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd) throws StandardException Make an Tuple Descriptor out of a SYSTRIGGERS row- Specified by:
buildDescriptor
in classCatalogRowFactory
- Parameters:
row
- a SYSTRIGGERS rowparentTupleDescriptor
- unuseddd
- dataDictionary- Returns:
- a descriptor equivalent to a SYSTRIGGERS row
- Throws:
StandardException
- thrown on failure
-
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.- Specified by:
buildColumnList
in classCatalogRowFactory
- Returns:
- array of SystemColumn suitable for making this catalog.
- Throws:
StandardException
-
getCharBoolean
private boolean getCharBoolean(DataValueDescriptor col, char trueValue, char falseValue) throws StandardException - Throws:
StandardException
-
getHeapColumnCount
Description copied from class:CatalogRowFactory
Get the number of columns in the heap.- Overrides:
getHeapColumnCount
in classCatalogRowFactory
- Returns:
- The number of columns in the heap.
- Throws:
StandardException
-