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

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


    int  checkConstraintCDLSize;

    // 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, verify that column being
      // renamed is not used in it's sql
      if (constraintDescriptor.getConstraintType() == DataDictionary.CHECK_CONSTRAINT)
      {
        checkConstraintCDL = constraintDescriptor.getColumnDescriptors();
View Full Code Here


    use dependency manager to pass the rename action to the
    dependents. */
    constraintDescriptorList = dd.getConstraintDescriptors(td);
    for(int index=0; index<constraintDescriptorList.size(); index++)
    {
      constraintDescriptor = constraintDescriptorList.elementAt(index);
      if (constraintDescriptor instanceof ReferencedKeyConstraintDescriptor)
        dm.invalidateFor(constraintDescriptor, DependencyManager.RENAME, lcc);
    }

    // Drop the table
View Full Code Here

    //look for foreign key dependency on the column.
    constraintDescriptorList = dd.getConstraintDescriptors(td);
    for(int index=0; index<constraintDescriptorList.size(); index++)
    {
      constraintDescriptor = constraintDescriptorList.elementAt(index);
      int[] referencedColumns = constraintDescriptor.getReferencedColumns();
      int numRefCols = referencedColumns.length;
      for (int j = 0; j < numRefCols; j++)
      {
        if ((referencedColumns[j] == columnPosition) &&
View Full Code Here

        ** For each FK that references this key, drop
        ** it.
        */
        for(int inner = 0; inner < fkcdl.size(); inner++)
        {
          fkcd = (ConstraintDescriptor) fkcdl.elementAt(inner);
          dm.invalidateFor(fkcd, DependencyManager.DROP_CONSTRAINT, lcc);
          dropConstraint(fkcd, td, activation, lcc, true);
          activation.addWarning(
            StandardException.newWarning(SQLState.LANG_CONSTRAINT_DROPPED,
               fkcd.getConstraintName(),
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

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


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

    ArrayList<ColumnDescriptorList> refColDescriptors = new ArrayList<ColumnDescriptorList>(1);
    ArrayList<int[]>                fkColMap = new ArrayList<int[]>(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)
                    {
                        constraints.add(cd);
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.