executorLists[i] = new Vector();
}
for (int i = 0; i < triggerInfo.triggerArray.length; i++)
{
TriggerDescriptor td = triggerInfo.triggerArray[i];
switch (td.getTriggerEventMask())
{
case TriggerDescriptor.TRIGGER_EVENT_INSERT:
if (td.isBeforeTrigger())
{
executorLists[TriggerEvent.BEFORE_INSERT].addElement(td);
}
else
{
executorLists[TriggerEvent.AFTER_INSERT].addElement(td);
}
break;
case TriggerDescriptor.TRIGGER_EVENT_DELETE:
if (td.isBeforeTrigger())
{
executorLists[TriggerEvent.BEFORE_DELETE].addElement(td);
}
else
{
executorLists[TriggerEvent.AFTER_DELETE].addElement(td);
}
break;
case TriggerDescriptor.TRIGGER_EVENT_UPDATE:
if (td.isBeforeTrigger())
{
executorLists[TriggerEvent.BEFORE_UPDATE].addElement(td);
}
else
{
executorLists[TriggerEvent.AFTER_UPDATE].addElement(td);
}
break;
default:
if (SanityManager.DEBUG)
{
SanityManager.THROWASSERT("bad trigger event "+td.getTriggerEventMask());
}
}
}
for (int i = 0; i < executorLists.length; i++)
{
int size = executorLists[i].size();
if (size > 0)
{
executors[i] = new GenericTriggerExecutor[size];
for (int j = 0; j < size; j++)
{
TriggerDescriptor td = (TriggerDescriptor)executorLists[i].elementAt(j);
executors[i][j] = (td.isRowTrigger()) ?
(GenericTriggerExecutor)new RowTriggerExecutor(tec, td, activation, lcc) :
(GenericTriggerExecutor)new StatementTriggerExecutor(tec, td, activation, lcc);
}
}
}