Sets the primary key.
354015
public AbstractSpecWithPrimaryKey<T> withPrimaryKey(PrimaryKey primaryKey) {
        if (primaryKey == null)
            this.keyComponents = null;
        else {
            this.keyComponents = primaryKey.getComponents();
        }
        return this;
    }
130471
public function setPrimaryKey(PrimaryKey $primaryKey)
    {
        foreach ($primaryKey->getColumnNames() as $columnName) {
            $this->getColumn($columnName)->setNotNull(true);
        }

        $this->primaryKey = $primaryKey;
    }
223460
public KeyArea setupKey(int iKeyArea)
    {
        KeyArea keyArea = null;
        if (iKeyArea == kIDKey)
        {
            keyArea = this.makeIndex(DBConstants.UNIQUE, "PrimaryKey");
            keyArea.addKeyField(kID, DBConstants.ASCENDING);
        }
        if (keyArea == null)
        {
            keyArea = super.setupKey(iKeyArea);     
            if (keyArea == null) if (iKeyArea < kAnalysisRecordLastKey)
                keyArea = new EmptyKey(this);
        }
        return keyArea;
    }
584046
def set(self, key, value):
        
        k = self._real_key(key.lower())
        self._override[k] = value
1078575
public function setPKValue(array $id)
    {
        if (count($id) !== count(static::$PKFieldName)) {
            throw new \InvalidArgumentException('Can`t set PK: passed values count not identical with primary key fields count');
        }

        if (count($id) === 1) {
            $this->{static::$PKFieldName[0]} = array_values($id)[0];

            return $this;
        }

        foreach ($id as $column => $value) {
            if ( ! self::isInPrimaryKey($column)) {
                throw new \InvalidArgumentException('Can`t set PK: Field `' . $column . '` is not a part of primary key.');
            }

            $this->$column = $value;
        }

        return $this;
    }
579541
@Deprecated
  public void setPrimaryKeys(String... primaryKeyFieldName) {
    setProp(ConfigurationKeys.EXTRACT_PRIMARY_KEY_FIELDS_KEY, Joiner.on(",").join(primaryKeyFieldName));
  }
952428
public void init(Rec record, int iKeyDup, String strKeyName)
    {
        m_vKeyFieldList = new Vector<Object>();
        m_record = (FieldList)record;
        m_iKeyDup = iKeyDup;
        m_strKeyName = strKeyName;
        if (m_record != null)
            m_record.addKeyArea(this);
        if (strKeyName != null)
            m_strKeyName = strKeyName;
        else
        {
            if (m_record != null) if (m_record.getKeyAreaCount() == 1)
                m_strKeyName = Constants.PRIMARY_KEY; // Default Primary key name
        }
    }
1314634
def set(self, key, value):
        
        db = self.open()
        try:
            db[key] = value
        finally:
            db.close()
465478
public TableKeysAndAttributes addPrimaryKey(PrimaryKey primaryKey) {
        if (primaryKey != null) {
            if (primaryKeys == null)
                primaryKeys = new ArrayList<PrimaryKey>();
            checkConsistency(primaryKey);
            this.primaryKeys.add(primaryKey);
        }
        return this;
    }
861255
@Override
    public void setPrimaryKey(WV value, Mapper mapper, String column, K primaryKey, Object Entity) {
    }
408692
public function setPrimaryKey($value)
    {
        if (!$keys = $this->primaryKey()) {
            throw new \Exception('Primary keys not defined for table `' . $this->name() . '`');
        }

        if (!$value) {
            $value = array_combine([current($keys)], [$value]);
        }

        foreach ($keys as $key) {
            $this[$key] = $value[$key];
        }

        return $this;
    }
1239585
public function setPrimaryKey( $key )
	{
		if( in_array( $key, $this->fields ) )
		{
			$this->primaryKey = $key;
			return TRUE;
		}
		return FALSE;
	}
295498
@Override
	public void setPrimaryKey(
		com.liferay.commerce.account.service.persistence.CommerceAccountOrganizationRelPK primaryKey) {
		_commerceAccountOrganizationRel.setPrimaryKey(primaryKey);
	}
1005722
protected function setId()
    {
        $this->id = $this->source->id;
        if ($this->getType() === Source::CreditNote) {
            $this->addProperties();
        }
    }
1047972
def get_primary_key(model):
    """"""
    model = get_model(model)
    return (field.name for field in model._meta.fields if field.primary_key).next()
982604
public void setValue(Object aValue)

   {

      if(aValue == null)

         return;

      

      primaryKey =Integer.parseInt(aValue.toString());

   }
1255161
def _set_value(self, entity, value):
    """"""
    if value is not None:
      value = _validate_key(value, entity=entity)
      value = entity._validate_key(value)
    entity._entity_key = value