Examples of TriggerDescriptor


Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    //truncate is not allowed when there are enabled DELETE triggers
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      if (trd.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) &&
        trd.isEnabled())
      {
        throw
          StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_ENABLED_DELETE_TRIGGERS,
                           td.getName(),trd.getName())
      }
    }

    //gather information from the existing conglomerate to create new one.
    emptyHeapRow = td.getEmptyExecRow();
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    Enumeration descs = tdl.elements();

    while (descs.hasMoreElements())
    {
      TriggerDescriptor td = (TriggerDescriptor)descs.nextElement();

      /*
      ** The dependent now depends on this trigger.
      ** the default dependent is the statement
      ** being compiled.
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    // need to deal with triggers if has referencedColumns
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      int[] referencedCols = trd.getReferencedCols();
      if (referencedCols == null)
        continue;
      int refColLen = referencedCols.length, j;
      boolean changed = false;
      for (j = 0; j < refColLen; j++)
      {
        if (referencedCols[j] > droppedColumnPosition)
                {
          changed = true;
                }
        else if (referencedCols[j] == droppedColumnPosition)
        {
          if (cascade)
          {
                        trd.drop(lcc);
            activation.addWarning(
              StandardException.newWarning(
                                SQLState.LANG_TRIGGER_DROPPED,
                                trd.getName(), td.getName()));
          }
          else
          // we'd better give an error if don't drop it,
            // otherwsie there would be unexpected behaviors
            throw StandardException.newException(
                            SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,
                            dm.getActionString(DependencyManager.DROP_COLUMN),
                            columnName, "TRIGGER",
                            trd.getName() );
          }
          break;
        }
      }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    //truncate is not allowed when there are enabled DELETE triggers
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      if (trd.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) &&
        trd.isEnabled())
      {
        throw
          StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_ENABLED_DELETE_TRIGGERS,
                           td.getName(),trd.getName())
      }
    }

    //gather information from the existing conglomerate to create new one.
    emptyHeapRow = td.getEmptyExecRow();
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    Enumeration descs = tdl.elements();

    while (descs.hasMoreElements())
    {
      TriggerDescriptor td = (TriggerDescriptor)descs.nextElement();

      /*
      ** The dependent now depends on this trigger.
      ** the default dependent is the statement
      ** being compiled.
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    Enumeration descs = tdl.elements();

    while (descs.hasMoreElements())
    {
      TriggerDescriptor td = (TriggerDescriptor)descs.nextElement();

      /*
      ** The dependent now depends on this trigger.
      ** the default dependent is the statement
      ** being compiled.
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    // need to deal with triggers if has referencedColumns
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      int[] referencedCols = trd.getReferencedCols();
      if (referencedCols == null)
        continue;
      int refColLen = referencedCols.length, j;
      boolean changed = false;
      for (j = 0; j < refColLen; j++)
      {
        if (referencedCols[j] > columnPosition)
          changed = true;
        else if (referencedCols[j] == columnPosition)
        {
          if (cascade)
          {
            DropTriggerConstantAction.dropTriggerDescriptor(lcc, dm, dd, tc, trd, activation);
            activation.addWarning(
              StandardException.newWarning(SQLState.LANG_TRIGGER_DROPPED,
                trd.getName(), td.getName()));
          }
          else
          // we'd better give an error if don't drop it,
            // otherwsie there would be unexpected behaviors
            throw StandardException.newException(SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,
                    dm.getActionString(DependencyManager.DROP_COLUMN),
                    columnInfo[ix].name, "TRIGGER",
                    trd.getName() );
          }
          break;
        }
      }
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    //truncate is not allowed when there are enabled DELETE triggers
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      if (trd.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) &&
        trd.isEnabled())
      {
        throw
          StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_ENABLED_DELETE_TRIGGERS,
                           td.getName(),trd.getName())
      }
    }

    //gather information from the existing conglomerate to create new one.
    emptyHeapRow = td.getEmptyExecRow(lcc.getContextManager());
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    /*
    ** Create the trigger descriptor first so the trigger action
    ** compilation can pick up the relevant trigger especially in
    ** the case of self triggering.
    */
    TriggerDescriptor triggerd =
        ddg.newTriggerDescriptor(
                  triggerSd,
                  tmpTriggerId,
                  triggerName,
                  eventMask,
View Full Code Here

Examples of org.apache.derby.iapi.sql.dictionary.TriggerDescriptor

    /* Drop the triggers */
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      DropTriggerConstantAction.dropTriggerDescriptor(lcc, dm, dd, tc, trd, activation)
    }

    /* Drop all defaults */
    ColumnDescriptorList cdl = td.getColumnDescriptorList();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.