Package org.apache.derby.iapi.sql.dictionary

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


    }

    //Now go through each trigger on this table and see if the column
    //being dropped is part of it's trigger columns or trigger action
    //columns which are used through REFERENCING clause
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
        for (Iterator descIter = tdl.iterator(); descIter.hasNext() ; ) {
            TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
      //If we find that the trigger is dependent on the column being
      //dropped because column is part of trigger columns list, then
      //we will give a warning or drop the trigger based on whether
      //ALTER TABLE DROP COLUMN is RESTRICT or CASCADE. In such a
View Full Code Here


        }
      }
    }

    //truncate is not allowed when there are enabled DELETE triggers
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
        for (Iterator descIter = tdl.iterator(); descIter.hasNext(); ) {
            TriggerDescriptor trd = (TriggerDescriptor)descIter.next();
      if (trd.listensForEvent(TriggerDescriptor.TRIGGER_EVENT_DELETE) &&
        trd.isEnabled())
      {
        throw
View Full Code Here

  private GenericDescriptorList getAllTriggerDescriptors()
    throws StandardException
  {
    TabInfoImpl          ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);

    GenericDescriptorList list = new GenericDescriptorList();

    getDescriptorViaHeap(
                        null,
            (ScanQualifier[][]) null,
            ti,
View Full Code Here

   * @exception StandardException    Thrown on failure
   */
  public GenericDescriptorList getTriggerDescriptors(TableDescriptor td)
    throws StandardException
  {
    GenericDescriptorList  gdl;

    if (td == null)
    {
      return getAllTriggerDescriptors();
    }

    /* Build the TableDescriptor's TDL if it is currently empty */
    gdl = td.getTriggerDescriptorList();

    /*
    ** Synchronize the building of the TDL.  The TDL itself is created
    ** empty when the TD is created, so there is no need to synchronize
    ** the getting of the TDL.
    */
    synchronized(gdl)
    {
      if (!gdl.getScanned())
      {
        getTriggerDescriptorsScan(td, false);
      }
    }

View Full Code Here

   * @exception StandardException    Thrown on failure
   */
   private void getTriggerDescriptorsScan(TableDescriptor td, boolean forUpdate)
      throws StandardException
  {
    GenericDescriptorList    gdl = (td).getTriggerDescriptorList();
    DataValueDescriptor    tableIDOrderable = null;
    TabInfoImpl          ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);

    /* Use tableIDOrderable in both start and stop positions for scan */
    tableIDOrderable = getIDValueAsCHAR(td.getUUID());

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);

    keyRow.setColumn(1, tableIDOrderable);

    getDescriptorViaIndex(
          SYSTRIGGERSRowFactory.SYSTRIGGERS_INDEX3_ID,
          keyRow,
          (ScanQualifier [][]) null,
          ti,
          (TupleDescriptor) null,
          gdl,
          forUpdate);
    gdl.setScanned(true);
  }
View Full Code Here

            if (val != null) {
                now.setTime(Long.parseLong(val));
            }
        }

        GenericDescriptorList tdl = dd.getTriggerDescriptors(triggerTable);
        int numTriggers = tdl.size();

        if (numTriggers == 0) {
            // This is the first trigger on the table, so no need to check
            // if there are any higher timestamps.
            return now;
        }

        // Get the timestamp of the most recent existing trigger on the table.
        Timestamp highest = ((TriggerDescriptor) tdl.get(numTriggers - 1))
                                                     .getCreationTimestamp();

        if (now.after(highest)) {
            // The current timestamp is higher than the most recent existing
            // trigger on the table, so it is OK.
View Full Code Here

    boolean[]  needsDeferredProcessing = new boolean[1];
    needsDeferredProcessing[0] = requiresDeferredProcessing();

    ArrayList conglomVector = new ArrayList();
    relevantCdl = new ConstraintDescriptorList();
    relevantTriggers =  new GenericDescriptorList();

    FormatableBitSet  columnMap = getUpdateReadMap
            (
             dd, baseTable, updateColumnList, conglomVector, relevantCdl,
             relevantTriggers, needsDeferredProcessing, affectedGeneratedColumns );
View Full Code Here

    }

    //Now go through each trigger on this table and see if the column
    //being dropped is part of it's trigger columns or trigger action
    //columns which are used through REFERENCING clause
    GenericDescriptorList tdl = dd.getTriggerDescriptors(td);
    Enumeration descs = tdl.elements();
    while (descs.hasMoreElements())
    {
      TriggerDescriptor trd = (TriggerDescriptor) descs.nextElement();
      //If we find that the trigger is dependent on the column being
      //dropped because column is part of trigger columns list, then
View Full Code Here

        }
      }
    }

    //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())
View Full Code Here

    )
    throws StandardException
  {
    if ( relevantTriggers !=  null ) { return relevantTriggers; }

    relevantTriggers =  new GenericDescriptorList();

    if(!includeTriggers)
      return relevantTriggers;

    td.getAllRelevantTriggers( statementType, changedColumnIds, relevantTriggers );
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.GenericDescriptorList

Copyright © 2018 www.massapicom. 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.