public function setId($oxid = null)
    {
        if ($oxid) {
            $this->_sOXID = $oxid;
        } else {
            if ($this->getCoreTableName() == 'oxobject2category') {
                $objectId = $this->oxobject2category__oxobjectid;
                $categoryId = $this->oxobject2category__oxcatnid;
                $shopID = $this->oxobject2category__oxshopid;
                $this->_sOXID = md5($objectId . $categoryId . $shopID);
            } else {
                $this->_sOXID = \OxidEsales\Eshop\Core\Registry::getUtilsObject()->generateUID();
            }
        }

        $idFieldName = $this->getCoreTableName() . '__oxid';
        $this->$idFieldName = new Field($this->_sOXID, Field::T_RAW);

        return $this->_sOXID;
    }