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

Examples of org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList.elementAt()


    //truncate table is not allowed if there are any tables referencing it.
    //except if it is self referencing.
    ConstraintDescriptorList cdl = dd.getConstraintDescriptors(td);
    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))
        {
View Full Code Here


    ValueNode          checkTree = null;

    // Get the text of all the check constraints
    for (int index = 0; index < ccCDLSize; index++)
    {
      ConstraintDescriptor cd = ccCDL.elementAt(index);

      String constraintText = cd.getConstraintText();

      // Get the query tree for this constraint
      ValueNode oneConstraint =
View Full Code Here

    Vector                              refColDescriptors = new Vector(1);
    Vector                              fkColMap = new Vector(1);
    int activeSize = activeList.size();
    for (int index = 0; index < activeSize; index++)
    {
      ConstraintDescriptor cd = activeList.elementAt(index);

      if (cd instanceof ForeignKeyConstraintDescriptor)
      {
        /*
        ** We are saving information for checking the
View Full Code Here

          ( ((ReferencedKeyConstraintDescriptor)cd).getForeignKeyConstraints(ConstraintDescriptor.ENABLED) );
 
        int fklSize = fkcdl.size();
        for (int inner = 0; inner < fklSize; inner++)
        {
          ConstraintDescriptor fkcd = fkcdl.elementAt(inner);
          if (dependent == null)
          {
            compilerContext.createDependency(fkcd);
            compilerContext.createDependency(fkcd.getTableDescriptor());
          }
View Full Code Here

      if (cdl != null) //table does have some pre-existing constraints defined on it
      {
        for (int i=0; i<cdl.size();i++)
        {
          cd = cdl.elementAt(i);
          //if the constraint type is not primary key or unique key, ignore it.
          if (cd.getConstraintType() == DataDictionary.PRIMARYKEY_CONSTRAINT ||
          cd.getConstraintType() == DataDictionary.UNIQUE_CONSTRAINT)
            constraintsVector.addElement(cd);
        }
View Full Code Here

      if (cdl != null) //table does have some pre-existing constraints defined on it
      {
        for (int i=0; i<cdl.size();i++)
        {
          cd = cdl.elementAt(i);
          //if the constraint type is not primary key or unique key, ignore it.
          if (cd.getConstraintType() == DataDictionary.PRIMARYKEY_CONSTRAINT ||
          cd.getConstraintType() == DataDictionary.UNIQUE_CONSTRAINT)
                    {
                        constraintsVector.add(cd);
View Full Code Here

      cdl = cd.getForeignKeyConstraints(ReferencedKeyConstraintDescriptor.ALL);
      int cdlSize = cdl.size();

      for(int index = 0; index < cdlSize; index++)
      {
        fkcd = (ForeignKeyConstraintDescriptor) cdl.elementAt(index);
        dm.invalidateFor(fkcd, DependencyManager.DROP_CONSTRAINT, lcc);
        dropConstraint(fkcd, activation, lcc, true);
      }
 
      /*
 
View Full Code Here

    intArray[0]                          = columnPosition;

    for (int index = 0; index < cdl.size(); index++)
    {
      ConstraintDescriptor existingConstraint =
                                        cdl.elementAt(index);

      if (!(existingConstraint instanceof KeyConstraintDescriptor))
        continue;

      if (!existingConstraint.columnIntersects(intArray))
View Full Code Here

        
        if (refcdl.size() > 0)
        {
          throw StandardException.newException(
             SQLState.LANG_MODIFY_COLUMN_REFERENCED,
                         name, refcdl.elementAt(0).getConstraintName());
        }
       
        // Make the statement dependent on the primary key constraint.
        getCompilerContext().createDependency(existingConstraint);
      }
View Full Code Here

    ConstraintDescriptor constraintDescriptor;

    // go through all the constraints defined on the table
    for (int index = 0; index < size; index++)
    {
      constraintDescriptor = constraintDescriptorList.elementAt(index);
      // if it is a check constraint, error
      if (constraintDescriptor.getConstraintType() == DataDictionary.CHECK_CONSTRAINT)
      {
        throw StandardException.newException(
            SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,
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.