Examples of ReferencedKeyConstraintDescriptor


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

      ** because of the way FK.getReferencedConstraint() works. 
      */
      if (constraint.getConstraintType()
          == DataDictionary.FOREIGNKEY_CONSTRAINT)
      {
        ReferencedKeyConstraintDescriptor refDescriptor =
            (ReferencedKeyConstraintDescriptor)
                getConstraintDescriptor(
                  ((ForeignKeyConstraintDescriptor)constraint).
                      getReferencedConstraintId());

        if (refDescriptor != null)
        {
          refDescriptor.decrementReferenceCount();
 
          int[] colsToSet = new int[1];
          colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;
   
          updateConstraintDescriptor(refDescriptor,
                        refDescriptor.getUUID(),
                        colsToSet,
                        tc);
        }
      }
    }
View Full Code Here

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

    for(int index = 0; index < cdl.size(); index++)
    {
      ConstraintDescriptor cd = cdl.elementAt(index);
      if (cd instanceof ReferencedKeyConstraintDescriptor)
      {
        ReferencedKeyConstraintDescriptor rfcd = (ReferencedKeyConstraintDescriptor) cd;
        if(rfcd.hasNonSelfReferencingFK(ConstraintDescriptor.ENABLED))
        {
          throw StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_FK_REFERENCE_TABLE,td.getName());
        }
      }
    }
View Full Code Here

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

      /*
      ** Now we need to bump the reference count of the
      ** contraint that this FK references
      */
      ReferencedKeyConstraintDescriptor refDescriptor =
              fkDescriptor.getReferencedConstraint();

      refDescriptor.incrementReferenceCount();

      int[] colsToSet = new int[1];
      colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;

      updateConstraintDescriptor(refDescriptor,
                      refDescriptor.getUUID(),
                      colsToSet,
                      tc);
    }
    else
    {
View Full Code Here

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

      ** because of the way FK.getReferencedConstraint() works. 
      */
      if (constraint.getConstraintType()
          == DataDictionary.FOREIGNKEY_CONSTRAINT)
      {
        ReferencedKeyConstraintDescriptor refDescriptor =
            (ReferencedKeyConstraintDescriptor)
                getConstraintDescriptor(
                  ((ForeignKeyConstraintDescriptor)constraint).
                      getReferencedConstraintId());

        if (refDescriptor != null)
        {
          refDescriptor.decrementReferenceCount();
 
          int[] colsToSet = new int[1];
          colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;
   
          updateConstraintDescriptor(refDescriptor,
                        refDescriptor.getUUID(),
                        colsToSet,
                        tc);
        }
      }
    }
View Full Code Here

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

      /*
      ** Now we need to bump the reference count of the
      ** contraint that this FK references
      */
      ReferencedKeyConstraintDescriptor refDescriptor =
              fkDescriptor.getReferencedConstraint();

      refDescriptor.incrementReferenceCount();

      int[] colsToSet = new int[1];
      colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;

      updateConstraintDescriptor(refDescriptor,
                      refDescriptor.getUUID(),
                      colsToSet,
                      tc);
    }
    else
    {
View Full Code Here

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

      ** because of the way FK.getReferencedConstraint() works. 
      */
      if (constraint.getConstraintType()
          == DataDictionary.FOREIGNKEY_CONSTRAINT)
      {
        ReferencedKeyConstraintDescriptor refDescriptor =
            (ReferencedKeyConstraintDescriptor)
                getConstraintDescriptor(
                  ((ForeignKeyConstraintDescriptor)constraint).
                      getReferencedConstraintId());

        if (refDescriptor != null)
        {
          refDescriptor.decrementReferenceCount();
 
          int[] colsToSet = new int[1];
          colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;
   
          updateConstraintDescriptor(refDescriptor,
                        refDescriptor.getUUID(),
                        colsToSet,
                        tc);
        }
      }
    }
View Full Code Here

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

    for(int index = 0; index < cdl.size(); index++)
    {
      ConstraintDescriptor cd = cdl.elementAt(index);
      if (cd instanceof ReferencedKeyConstraintDescriptor)
      {
        ReferencedKeyConstraintDescriptor rfcd = (ReferencedKeyConstraintDescriptor) cd;
        if(rfcd.hasNonSelfReferencingFK(ConstraintDescriptor.ENABLED))
        {
          throw StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_FK_REFERENCE_TABLE,td.getName());
        }
      }
    }
View Full Code Here

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

      ** because of the way FK.getReferencedConstraint() works. 
      */
      if (constraint.getConstraintType()
          == DataDictionary.FOREIGNKEY_CONSTRAINT)
      {
        ReferencedKeyConstraintDescriptor refDescriptor =
            (ReferencedKeyConstraintDescriptor)
                getConstraintDescriptor(
                  ((ForeignKeyConstraintDescriptor)constraint).
                      getReferencedConstraintId());

        if (refDescriptor != null)
        {
          refDescriptor.decrementReferenceCount();
 
          int[] colsToSet = new int[1];
          colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;
   
          updateConstraintDescriptor(refDescriptor,
                        refDescriptor.getUUID(),
                        colsToSet,
                        tc);
        }
      }
    }
View Full Code Here

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

    for(int index = 0; index < cdl.size(); index++)
    {
      ConstraintDescriptor cd = cdl.elementAt(index);
      if (cd instanceof ReferencedKeyConstraintDescriptor)
      {
        ReferencedKeyConstraintDescriptor rfcd = (ReferencedKeyConstraintDescriptor) cd;
        if(rfcd.hasNonSelfReferencingFK(ConstraintDescriptor.ENABLED))
        {
          throw StandardException.newException(SQLState.LANG_NO_TRUNCATE_ON_FK_REFERENCE_TABLE,td.getName());
        }
      }
    }
View Full Code Here

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

      /*
      ** Now we need to bump the reference count of the
      ** contraint that this FK references
      */
      ReferencedKeyConstraintDescriptor refDescriptor =
              fkDescriptor.getReferencedConstraint();

      refDescriptor.incrementReferenceCount();

      int[] colsToSet = new int[1];
      colsToSet[0] = SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_REFERENCECOUNT;

      updateConstraintDescriptor(refDescriptor,
                      refDescriptor.getUUID(),
                      colsToSet,
                      tc);
    }
    else
    {
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.