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

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


    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here


    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

            final TransactionController tc = lcc.getTransactionExecute();
            final Enumeration<?> e = ht.elements();

            DataDictionary dd = lcc.getDataDictionary();
            KeyConstraintDescriptor cd = (KeyConstraintDescriptor)
                    dd.getConstraintDescriptor(constraintId);

            if (cd == null) {
                // Constraint dropped, nothing to do.
                return;
            }

            long indexCID = cd.getIndexConglomerateDescriptor(dd)
                              .getConglomerateNumber();

            while (e.hasMoreElements()) {
                final DataValueDescriptor[] key =
                        (DataValueDescriptor[])e.nextElement();

                // FIXME: This is not very efficient: we could sort the rows in
                // the hash table, and then check all rows using a single scan.
                ScanController indexSC = null;
                boolean sawException = false;

                try {
                    indexSC = tc.openScan(
                        indexCID,
                        false,
                        0, // read only
                        TransactionController.MODE_RECORD,
                        TransactionController.ISOLATION_READ_COMMITTED_NOHOLDLOCK,
                        (FormatableBitSet)null, // retrieve all fields
                        key,
                        ScanController.GE, // startSearchOp
                        null,
                        key,
                        ScanController.GT);

                    if (indexSC.next()) {
                        if (indexSC.next()) {
                            // two matching rows found, constraint violated
                            throw StandardException.newException(
                                rollbackOnError ?
                                SQLState.
                                    LANG_DEFERRED_DUPLICATE_KEY_CONSTRAINT_T :
                                SQLState.
                                    LANG_DEFERRED_DUPLICATE_KEY_CONSTRAINT_S,
                                cd.getConstraintName(),
                                cd.getTableDescriptor().getName());
                        } // else exactly one row contains key: OK
                    } else {
                        // No rows contain key: OK, must have been deleted later
                        // in transaction, or we got here due to pessimistic
                        // assumption on a timeout while checking on the insert.
View Full Code Here

    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

      if (! (cd instanceof KeyConstraintDescriptor))
      {
        continue;
      }

      KeyConstraintDescriptor keyCD = (KeyConstraintDescriptor) cd;

      if (keyCD.getIndexId().equals(indexUUID))
      {
        retCD = cd;
        break;
      }
    }
View Full Code Here

    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

      if (! (cd instanceof KeyConstraintDescriptor))
      {
        continue;
      }

      KeyConstraintDescriptor keyCD = (KeyConstraintDescriptor) cd;

      if (keyCD.getIndexId().equals(indexUUID))
      {
        retCD = cd;
        break;
      }
    }
View Full Code Here

    String          constraintID = null;
    String          conglomerateID = null;

    if (td != null)
    {
      KeyConstraintDescriptor  constraint = (KeyConstraintDescriptor)td;

      /*
      ** We only allocate a new UUID if the descriptor doesn't already have one.
      ** For descriptors replicated from a Source system, we already have an UUID.
      */
      oid = constraint.getUUID();
      constraintID = oid.toString();

      conglomerateID = constraint.getIndexUUIDString();
    }

    /* Insert info into syskeys */

    /* RESOLVE - It would be nice to require less knowledge about syskeys
View Full Code Here

TOP

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

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.