Get a unique key that can be used to reposition to this record.
@exception DBException File exception.
325398
public Object getHandle(int iHandleType) throws DBException
    {
        if (iHandleType == DBConstants.OBJECT_ID_HANDLE)
            iHandleType = DBConstants.FULL_OBJECT_HANDLE; // Get the source table also
        if (this.getCurrentTable() == null)
            return null;
        Object object = this.getCurrentTable().getHandle(iHandleType);
        if (iHandleType == DBConstants.DATA_SOURCE_HANDLE)
            object = new FullDataSource(this.getCurrentTable(), object);
        return object;
    }
201143
public static Key<ConfigRecord> getKey (String node, String object, String field)
    {
        return newKey(_R, node, object, field);
    }
85001
public String getRepoKey() {
        String repoKey;
        if (isDynamicMode()) {
            repoKey = keyFromText;
        } else {
            repoKey = keyFromSelect;
        }
        return repoKey;
    }
505692
function(key) {
      var that = this;

      if (!this._key || !key) {
        return Promise.reject(new Error('No unique key specified'));
      }

      var props = {};
      props[this._key] = key;

      return this._dbApi.find(props).then(function(docs) {
        return that._readDoc(docs[0]);
      });
    }
1030999
protected KeyRecord getKeyRecord (int keyCode)
    {
        KeyRecord krec = _keys.get(keyCode);
        if (krec == null) {
            krec = new KeyRecord();
            _keys.put(keyCode, krec);
        }
        return krec;
    }
319406
public function setUniqueKey($uniqueKey)
    {
        if (! is_null($this->uniqueKey)) {
            throw new RuntimeException('The unique key was already set.');
        }
        if (! is_int($uniqueKey) && ! is_string($uniqueKey)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid type of specified unique key; must be an integer or '
                . 'an string, "%s" received.',
                gettype($uniqueKey)
            ));
        }
        $this->uniqueKey = $uniqueKey;
    }
178691
public long getUniqueValue() throws PersistenceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getUniqueValue");

        long retval;
            
        synchronized (_globalUniqueLock) 
        {
            if (_globalUnique == _globalUniqueThreshold) 
            {
                _globalUniqueManager.scheduleUpdate(this);
            }
            else if (_globalUnique == _globalUniqueLimit) 
            {
                _globalUniqueManager.updateEntry(this);
                nextRangeMaximumAvailable();
            }
            
            retval = _globalUnique++;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getUniqueValue", "return="+retval);
        return retval;
    }
204295
public Long move(Object key, int dbIndex) {
		Jedis jedis = getJedis();
		try {
			return jedis.move(keyToBytes(key), dbIndex);
		}
		finally {close(jedis);}
	}
1295334
public static String findUniqueKey(JSONArray expected) throws JSONException {
        // Find a unique key for the object (id, name, whatever)
        JSONObject o = (JSONObject) expected.get(0); // There's at least one at this point
        for (String candidate : getKeys(o)) {
            if (isUsableAsUniqueKey(candidate, expected)) return candidate;
        }
        // No usable unique key :-(
        return null;
    }
1193156
public KeyArea setupKey(int iKeyArea)
    {
        KeyArea keyArea = null;
        if (iKeyArea == 0)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY);
            keyArea.addKeyField(ID, DBConstants.ASCENDING);
        }
        if (iKeyArea == 1)
        {
            keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, FIELD_FILE_NAME_KEY);
            keyArea.addKeyField(FIELD_FILE_NAME, DBConstants.ASCENDING);
            keyArea.addKeyField(FIELD_SEQ_NO, DBConstants.ASCENDING);
        }
        if (iKeyArea == 2)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, FIELD_NAME_KEY);
            keyArea.addKeyField(FIELD_FILE_NAME, DBConstants.ASCENDING);
            keyArea.addKeyField(FIELD_NAME, DBConstants.ASCENDING);
        }
        if (keyArea == null)
            keyArea = super.setupKey(iKeyArea);     
        return keyArea;
    }
27489
private Instance getExistingKey(final String _key)
    {
        Instance ret = null;
        try {
            final QueryBuilder queryBldr = new QueryBuilder(Type.get(DBPropertiesUpdate.TYPE_PROPERTIES));
            queryBldr.addWhereAttrEqValue("Key", _key);
            queryBldr.addWhereAttrEqValue("BundleID", this.bundleInstance);
            final InstanceQuery query = queryBldr.getQuery();
            query.executeWithoutAccessCheck();
            if (query.next()) {
                ret = query.getCurrentValue();
            }
        } catch (final EFapsException e) {
            DBPropertiesUpdate.LOG.error("getExisting()", e);
        }
        return ret;
    }
646954
public KeyArea setupKey(int iKeyArea)
    {
        KeyArea keyArea = null;
        if (iKeyArea == 0)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY);
            keyArea.addKeyField(ID, DBConstants.ASCENDING);
        }
        if (iKeyArea == 1)
        {
            keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, CLASS_INFO_ID_KEY);
            keyArea.addKeyField(CLASS_INFO_ID, DBConstants.ASCENDING);
        }
        if (keyArea == null)
            keyArea = super.setupKey(iKeyArea);     
        return keyArea;
    }
396606
def _unique_key(job):
    
    return unique_key(testtype=str(job['testtype']),
                      buildtype=str(job['platform_option']),
                      platform=str(job['platform']))
902674
public KeyArea setupKey(int iKeyArea)
    {
        KeyArea keyArea = null;
        if (iKeyArea == 0)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY);
            keyArea.addKeyField(ID, DBConstants.ASCENDING);
        }
        if (iKeyArea == 1)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, FILE_NAME_KEY);
            keyArea.addKeyField(FILE_NAME, DBConstants.ASCENDING);
        }
        if (keyArea == null)
            keyArea = super.setupKey(iKeyArea);     
        return keyArea;
    }
382862
def unique_key(connection):
    
    while 1:
        key = str(uuid.uuid4().hex)
        if not connection.exists(key):
            break
    return key
75498
public FieldList moveThruMultipleTables(int iRelPosition) throws DBException
    { // ****ONLY TESTED FOR iRelPosition = +1****
        boolean bIsOpen = m_bIsOpen;
        if (!m_bIsOpen)
            this.open();
        BaseTable table = null;
        BaseTable tableNext = null;
        if (((m_iRecordStatus & DBConstants.RECORD_NEXT_PENDING) == DBConstants.RECORD_NEXT_PENDING)
            && (iRelPosition == DBConstants.NEXT_RECORD))
        {
            m_iRecordStatus = DBConstants.RECORD_NORMAL;
            tableNext = this.getCurrentTable();   // Special case - last call was hasNext()
        }
        else if (((m_iRecordStatus & DBConstants.RECORD_PREVIOUS_PENDING) == DBConstants.RECORD_PREVIOUS_PENDING)
            && (iRelPosition == DBConstants.PREVIOUS_RECORD))
        {
            m_iRecordStatus = DBConstants.RECORD_NORMAL;
            tableNext = this.getCurrentTable();   // Special case - last call was hasNext()
        }
        else
        { // First, make sure all the tables are opened and positioned on valid records.
            if ((!bIsOpen) || (iRelPosition == DBConstants.FIRST_RECORD))   // Need to use a different variable
            {   // If this is the first time thru, open and move to the first record
                Iterator<BaseTable> iterator = this.getTables();
                while (iterator.hasNext())
                {
                    table = iterator.next();
                    table.close();
                    table.getRecord().setKeyArea(this.getRecord().getDefaultOrder());
                    if (table.hasNext())
                    {
                        if (table != this.getCurrentTable())
                            table.move(+1);   // Move to first record
                        else
                            iRelPosition = +1;
                    }
                }
                m_bIsOpen = true; // Yes this file is now open.
            }
            if (!this.getCurrentTable().isEOF())
                this.getCurrentTable().move(iRelPosition);  // First, move the current table in the correct direction.
        // Now, compare the records to find the lowest key
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {
                table = iterator.next();
                if (!table.isEOF())
                {
                    if (tableNext == null)
                        tableNext = table;      // None here yet, this is the lowest
                    else
                    { // Now compare and get the lowest
                        int iCompareValue = 0;
                        int iKeyFields = table.getRecord().getKeyArea().getKeyFields() + DBConstants.MAIN_KEY_FIELD;
                        for (int iKeyFieldSeq = DBConstants.MAIN_KEY_FIELD; iKeyFieldSeq < iKeyFields; iKeyFieldSeq++)
                        {
                            BaseField fldCompare = table.getRecord().getKeyArea().getKeyField(iKeyFieldSeq).getField(DBConstants.FILE_KEY_AREA);
                            BaseField fldNext = tableNext.getRecord().getKeyArea().getKeyField(iKeyFieldSeq).getField(DBConstants.FILE_KEY_AREA);
                            iCompareValue = fldCompare.compareTo(fldNext);
                            if (this.getRecord().getKeyArea() != null)
                                if (this.getRecord().getKeyArea().getKeyField(iKeyFieldSeq) != null)
                                    if (this.getRecord().getKeyArea().getKeyOrder(iKeyFieldSeq) == DBConstants.DESCENDING)
                                iCompareValue = -iCompareValue;
                            if (iCompareValue != 0)
                                break;
                        }
                        if (iCompareValue < 0)
                            tableNext = table;      // This is the lowest so far.
                    }
                }
            }
        }
        if (tableNext == null)
        {
            Iterator<BaseTable> iterator = this.getTables();
            while (iterator.hasNext())
            {   // If this table is suppose to be PAST EOF, make sure all the records are too.
                table = iterator.next();
                if (iRelPosition == DBConstants.NEXT_RECORD)
                    if (table.isEOF())
                        table.move(+1);
            }
            return null;
        }
        this.setCurrentTable(tableNext);    // Never allow currentTable to be null.
        Record record = tableNext.getRecord();
        for (int iFieldSeq = DBConstants.MAIN_FIELD; iFieldSeq < record.getFieldCount(); ++iFieldSeq)
        {
//?         if (bDisplayOption)
            record.getField(iFieldSeq).displayField();      // Display this field
        }
        return record;
    }
1204385
public Record moveTableQuery(int iRelPosition) throws DBException
    {
        BaseTable table = null;
        Record record = null;
        Record recordLeft = null;
        boolean bFirstTime = true;
        for (Enumeration<TableLink> e = m_LinkageList.elements() ; e.hasMoreElements() ;)
        {
            TableLink tableLink = e.nextElement();
            table = tableLink.getLeftRecord().getTable();
            if (bFirstTime)
            {   // First time through - far left table!
                recordLeft = record = (Record)table.move(iRelPosition);
                if (record == null)
                    break;
            }
            table = tableLink.getRightRecord().getTable();
            record = table.getRecord();
            record.addNew();
            tableLink.moveDataRight();  // Fill the right table with key
            boolean bFound = record.seek("=");
            if (!bFound)
            {
                if (tableLink.getJoinType() == DBConstants.LEFT_OUTER)  // DBConstants.LEFT_INNER)
                    record.initRecord(DBConstants.DISPLAY);
                else
                {   // Skip this record **NOT TESTED**
                    if ((iRelPosition > 0) || (iRelPosition == DBConstants.FIRST_RECORD))
                        return this.moveTableQuery(+1);
                    return this.moveTableQuery(-1);
                }
            }
            bFirstTime = false;
        }
        // Sync the mode
        if (recordLeft != null)
        {   // Special test for local criteria
            if ((this.handleLocalCriteria(null, false, null) == false)
                || (this.handleRemoteCriteria(null, false, null) == false))
            { // This record didn't pass the test, get the next one that matches
                if ((iRelPosition > 0) || (iRelPosition == DBConstants.FIRST_RECORD))
                    return this.moveTableQuery(+1);
                return this.moveTableQuery(-1);
            }
            this.setEditMode(recordLeft.getEditMode());
        }
        else
            this.setEditMode(DBConstants.END_OF_FILE);
        return recordLeft;
    }