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

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


    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

            new ConstraintDescriptor[csdl_size];

    // let's go downwards, don't want to get messed up while removing
    for (int i = csdl_size - 1; i >= 0; i--)
    {
      ConstraintDescriptor cd = csdl.elementAt(i);
      int[] referencedColumns = cd.getReferencedColumns();
      int numRefCols = referencedColumns.length, j;
      boolean changed = false;
      for (j = 0; j < numRefCols; j++)
      {
View Full Code Here

      {
        ConstraintDescriptorList fkcdl = dd.getForeignKeys(cd.getUUID());
        for (int j = 0; j < fkcdl.size(); j++)
        {
          ConstraintDescriptor fkcd =
                        (ConstraintDescriptor) fkcdl.elementAt(j);

          dm.invalidateFor(fkcd,
                  DependencyManager.DROP_CONSTRAINT,
                  lcc);
View Full Code Here

        //check if there are any unique constraints to update
        ConstraintDescriptorList cdl = dd.getConstraintDescriptors(td);
        int columnPostion = columnDescriptor.getPosition();
        for (int i = 0; i < cdl.size(); i++)
        {
            ConstraintDescriptor cd = cdl.elementAt(i);
            if (cd.getConstraintType() == DataDictionary.UNIQUE_CONSTRAINT)
            {
                ColumnDescriptorList columns = cd.getColumnDescriptors();
                for (int count = 0; count < columns.size(); count++)
                {
View Full Code Here

    //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

    ConstraintDescriptor[] toBeRemoved = new ConstraintDescriptor[csdl_size];

    // let's go downwards, don't want to get messed up while removing
    for (int i = csdl_size - 1; i >= 0; i--)
    {
      ConstraintDescriptor cd = csdl.elementAt(i);
      int[] referencedColumns = cd.getReferencedColumns();
      int numRefCols = referencedColumns.length, j;
      boolean changed = false;
      for (j = 0; j < numRefCols; j++)
      {
View Full Code Here

      if (cascade)
      {
        ConstraintDescriptorList fkcdl = dd.getForeignKeys(cd.getUUID());
        for (int j = 0; j < fkcdl.size(); j++)
        {
          ConstraintDescriptor fkcd = (ConstraintDescriptor) fkcdl.elementAt(j);
          dm.invalidateFor(fkcd,
                  DependencyManager.DROP_CONSTRAINT,
                  lcc);

          DropConstraintConstantAction.dropConstraintAndIndex(
View Full Code Here

    //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

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.