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

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


    Vector                fkVector = new Vector(10);
    int                 type;
    UUID[]                 uuids = null;
    long[]                 conglomNumbers = null;
    String[]              fkNames = null;
    ConstraintDescriptorList      fkcdl;
    ReferencedKeyConstraintDescriptor  refcd;
    boolean[]              isSelfReferencingFK;
    ConstraintDescriptorList      activeList = dd.getActiveConstraintDescriptors(cdl);
    int[]                rowMap = getRowMap(readColsBitSet, td);
    int[]                               raRules = null;
    Vector                              refTableNames = new Vector(1);
    Vector                              refIndexConglomNum = new Vector(1);
    Vector                              refActions = new Vector(1);
    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


      ** the index number will change, so we'll add a
      ** dependency on all tables we will scan.
      */
      if (cd instanceof ReferencedKeyConstraintDescriptor)
      { 
        ConstraintDescriptorList fkcdl = dd.getActiveConstraintDescriptors
          ( ((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

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

    boolean[]  needsDeferredProcessing = new boolean[1];
    relevantCdl = new ConstraintDescriptorList();

    needsDeferredProcessing[0] = requiresDeferredProcessing;
    td.getAllRelevantConstraints
      ( statementType, skipCheckConstraints, changedColumnIds,
        needsDeferredProcessing, relevantCdl );
View Full Code Here

    if (cascadeOnRefKey)
    {
      ForeignKeyConstraintDescriptor fkcd;
      ReferencedKeyConstraintDescriptor cd;
      ConstraintDescriptorList cdl;

      cd = (ReferencedKeyConstraintDescriptor)conDesc;
      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);
        dropConstraintAndIndex(dm, fkcd.getTableDescriptor(), dd, fkcd,
                tc, lcc, true);
      }
 
View Full Code Here

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

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

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

    if (td != null)
    {
      //In case of alter table, get the already existing primary key and unique
      //key constraints for this table. And then we will compare them with  new
      //primary key/unique key constraint column lists.
      ConstraintDescriptorList cdl = dd.getConstraintDescriptors(td);
      ConstraintDescriptor cd;

      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

  private ConstraintDescriptorList getAllConstraintDescriptors()
    throws StandardException
  {
    TabInfoImpl          ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);

    ConstraintDescriptorList list = new ConstraintDescriptorList();

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

   * @exception StandardException    Thrown on failure
   */
  public ConstraintDescriptorList getConstraintDescriptors(TableDescriptor td)
    throws StandardException
  {
    ConstraintDescriptorList  cdl;

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

    /* RESOLVE - need to look at multi-user aspects of hanging constraint
     * descriptor list off of table descriptor when we restore the cache.
     */

    /* Build the TableDescriptor's CDL if it is currently empty */
    cdl = td.getConstraintDescriptorList();

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

View Full Code Here

   * @exception StandardException    Thrown on failure
   */
   private void getConstraintDescriptorsScan(TableDescriptor td, boolean forUpdate)
      throws StandardException
  {
    ConstraintDescriptorList  cdl = td.getConstraintDescriptorList();
    DataValueDescriptor      tableIDOrderable = null;
    TabInfoImpl            ti = getNonCoreTI(SYSCONSTRAINTS_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);

    getConstraintDescriptorViaIndex(
          SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX3_ID,
          keyRow,
          ti,
          td,
          cdl,
          forUpdate);
    cdl.setScanned(true);
  }
View Full Code Here

            fkList,
            false);

    SubKeyConstraintDescriptor cd;
    TableDescriptor td;
    ConstraintDescriptorList cdl = new ConstraintDescriptorList();
    ConstraintDescriptorList tmpCdl;

    for (Iterator iterator = fkList.iterator(); iterator.hasNext(); )
    {
      cd = (SubKeyConstraintDescriptor) iterator.next();
      td = getConstraintTableDescriptor(cd.getUUID());
View Full Code Here

TOP

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

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.