ExecRow row,
TupleDescriptor parentTupleDescriptor,
DataDictionary dd
) throws StandardException
{
DataValueDescriptor col;
String name;
char theChar;
String uuidStr;
String triggerDefinition;
String oldReferencingName;
String newReferencingName;
UUID uuid;
UUID suuid; // schema
UUID tuuid; // referenced table
UUID actionSPSID = null; // action sps uuid string
UUID whenSPSID = null; // when clause sps uuid string
Timestamp createTime;
int eventMask = 0;
boolean isBefore;
boolean isRow;
boolean isEnabled;
boolean referencingOld;
boolean referencingNew;
ReferencedColumns rcd;
TriggerDescriptor descriptor;
DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
if (SanityManager.DEBUG)
{
SanityManager.ASSERT(row.nColumns() == SYSTRIGGERS_COLUMN_COUNT,
"Wrong number of columns for a SYSTRIGGERS row");
}
// 1st column is TRIGGERID (UUID - char(36))
col = row.getColumn(1);
uuidStr = col.getString();
uuid = getUUIDFactory().recreateUUID(uuidStr);
// 2nd column is TRIGGERNAME (varchar(128))
col = row.getColumn(2);
name = col.getString();
// 3rd column is SCHEMAID (UUID - char(36))
col = row.getColumn(3);
uuidStr = col.getString();
suuid = getUUIDFactory().recreateUUID(uuidStr);
// 4th column is CREATIONTIMESTAMP (TIMESTAMP)
col = row.getColumn(4);
createTime = (Timestamp) col.getObject();
// 5th column is EVENT (char(1))
col = row.getColumn(5);
theChar = col.getString().charAt(0);
switch (theChar)
{
case 'U':
eventMask = TriggerDescriptor.TRIGGER_EVENT_UPDATE;
break;
case 'I':
eventMask = TriggerDescriptor.TRIGGER_EVENT_INSERT;
break;
case 'D':
eventMask = TriggerDescriptor.TRIGGER_EVENT_DELETE;
break;
default:
if (SanityManager.DEBUG)
{
SanityManager.THROWASSERT("bad event mask: "+theChar);
}
}
// 6th column is FIRINGTIME (char(1))
isBefore = getCharBoolean(row.getColumn(6), 'B', 'A');
// 7th column is TYPE (char(1))
isRow = getCharBoolean(row.getColumn(7), 'R', 'S');
// 8th column is STATE (char(1))
isEnabled = getCharBoolean(row.getColumn(8), 'E', 'D');
// 9th column is TABLEID (UUID - char(36))
col = row.getColumn(9);
uuidStr = col.getString();
tuuid = getUUIDFactory().recreateUUID(uuidStr);
// 10th column is WHENSTMTID (UUID - char(36))
col = row.getColumn(10);
uuidStr = col.getString();
if (uuidStr != null)
whenSPSID = getUUIDFactory().recreateUUID(uuidStr);
// 11th column is ACTIONSTMTID (UUID - char(36))
col = row.getColumn(11);
uuidStr = col.getString();
if (uuidStr != null)
actionSPSID = getUUIDFactory().recreateUUID(uuidStr);
// 12th column is REFERENCEDCOLUMNS user type org.apache.derby.catalog.ReferencedColumns
col = row.getColumn(12);
rcd = (ReferencedColumns) col.getObject();
// 13th column is TRIGGERDEFINITION (longvarhar)
col = row.getColumn(13);
triggerDefinition = col.getString();
// 14th column is REFERENCINGOLD (boolean)
col = row.getColumn(14);
referencingOld = col.getBoolean();
// 15th column is REFERENCINGNEW (boolean)
col = row.getColumn(15);
referencingNew = col.getBoolean();
// 16th column is REFERENCINGNAME (varchar(128))
col = row.getColumn(16);
oldReferencingName = col.getString();
// 17th column is REFERENCINGNAME (varchar(128))
col = row.getColumn(17);
newReferencingName = col.getString();
descriptor = new TriggerDescriptor(
dd,
dd.getSchemaDescriptor(suuid, null),
uuid,