Class SYSTRIGGERSRowFactory
- java.lang.Object
-
- org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
-
- org.apache.derby.impl.sql.catalog.SYSTRIGGERSRowFactory
-
public class SYSTRIGGERSRowFactory extends CatalogRowFactory
Factory for creating a SYSTRIGGERS row.- Version:
- 0.1
-
-
Field Summary
-
Fields inherited from class org.apache.derby.iapi.sql.dictionary.CatalogRowFactory
dvf, heapUUID, indexNames, indexUniqueness, indexUUID, tableUUID
-
-
Constructor Summary
Constructors Constructor Description SYSTRIGGERSRowFactory(DataDictionary dd, UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemColumn[]
buildColumnList()
Builds a list of columns suitable for creating this Catalog.TupleDescriptor
buildDescriptor(ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd)
Make an Tuple Descriptor out of a SYSTRIGGERS rowprivate java.util.Calendar
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)
int
getHeapColumnCount()
Get the number of columns in the heap.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.private ExecRow
makeRow(TupleDescriptor td, int columnCount)
Helper method that contains common logic formakeRow()
andmakeEmptyRowForCurrentVersion()
.ExecRow
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 Detail
-
TABLENAME_STRING
static final java.lang.String TABLENAME_STRING
- See Also:
- Constant Field Values
-
SYSTRIGGERS_TRIGGERID
public static final int SYSTRIGGERS_TRIGGERID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_TRIGGERNAME
public static final int SYSTRIGGERS_TRIGGERNAME
- See Also:
- Constant Field Values
-
SYSTRIGGERS_SCHEMAID
public static final int SYSTRIGGERS_SCHEMAID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_CREATIONTIMESTAMP
public static final int SYSTRIGGERS_CREATIONTIMESTAMP
- See Also:
- Constant Field Values
-
SYSTRIGGERS_EVENT
public static final int SYSTRIGGERS_EVENT
- See Also:
- Constant Field Values
-
SYSTRIGGERS_FIRINGTIME
public static final int SYSTRIGGERS_FIRINGTIME
- See Also:
- Constant Field Values
-
SYSTRIGGERS_TYPE
public static final int SYSTRIGGERS_TYPE
- See Also:
- Constant Field Values
-
SYSTRIGGERS_STATE
public static final int SYSTRIGGERS_STATE
- See Also:
- Constant Field Values
-
SYSTRIGGERS_TABLEID
public static final int SYSTRIGGERS_TABLEID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_WHENSTMTID
public static final int SYSTRIGGERS_WHENSTMTID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_ACTIONSTMTID
public static final int SYSTRIGGERS_ACTIONSTMTID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_REFERENCEDCOLUMNS
public static final int SYSTRIGGERS_REFERENCEDCOLUMNS
- See Also:
- Constant Field Values
-
SYSTRIGGERS_TRIGGERDEFINITION
public static final int SYSTRIGGERS_TRIGGERDEFINITION
- See Also:
- Constant Field Values
-
SYSTRIGGERS_REFERENCINGOLD
public static final int SYSTRIGGERS_REFERENCINGOLD
- See Also:
- Constant Field Values
-
SYSTRIGGERS_REFERENCINGNEW
public static final int SYSTRIGGERS_REFERENCINGNEW
- See Also:
- Constant Field Values
-
SYSTRIGGERS_OLDREFERENCINGNAME
public static final int SYSTRIGGERS_OLDREFERENCINGNAME
- See Also:
- Constant Field Values
-
SYSTRIGGERS_NEWREFERENCINGNAME
public static final int SYSTRIGGERS_NEWREFERENCINGNAME
- See Also:
- Constant Field Values
-
SYSTRIGGERS_WHENCLAUSETEXT
public static final int SYSTRIGGERS_WHENCLAUSETEXT
- See Also:
- Constant Field Values
-
SYSTRIGGERS_COLUMN_COUNT
public static final int SYSTRIGGERS_COLUMN_COUNT
- See Also:
- Constant Field Values
-
SYSTRIGGERS_INDEX1_ID
public static final int SYSTRIGGERS_INDEX1_ID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_INDEX2_ID
public static final int SYSTRIGGERS_INDEX2_ID
- See Also:
- Constant Field Values
-
SYSTRIGGERS_INDEX3_ID
public static final int SYSTRIGGERS_INDEX3_ID
- See Also:
- Constant Field Values
-
indexColumnPositions
private static final int[][] indexColumnPositions
-
uniqueness
private static final boolean[] uniqueness
-
uuids
private static final java.lang.String[] uuids
-
UTC
private static final java.util.TimeZone UTC
TimeZone object representing Coordinated Universal Time.
-
dataDictionary
private final DataDictionary dataDictionary
-
-
Constructor Detail
-
SYSTRIGGERSRowFactory
SYSTRIGGERSRowFactory(DataDictionary dd, UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf) throws StandardException
- Throws:
StandardException
-
-
Method Detail
-
makeRow
public ExecRow makeRow(TupleDescriptor td, TupleDescriptor parent) throws StandardException
Make a SYSTRIGGERS row.- Overrides:
makeRow
in classCatalogRowFactory
- Returns:
- Row suitable for inserting into SYSTRIGGERS.
- Throws:
StandardException
- thrown on failure
-
makeEmptyRowForCurrentVersion
public ExecRow makeEmptyRowForCurrentVersion() throws StandardException
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
private ExecRow makeRow(TupleDescriptor td, int columnCount) throws StandardException
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
private java.util.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:
- 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
public SystemColumn[] buildColumnList() throws StandardException
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
public int getHeapColumnCount() throws StandardException
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
-
-