protected function generatePropertyHashes()
    {
        if ($this->read_only) {
            return;
        }

        // Note: SwatDBDataObject::generatePropertyHash() is not used
        // here because it would mean calling the expensive getProperties()
        // method in a loop.
        foreach ($this->getProperties() as $name => $value) {
            $hashed_value = $this->getHashValue($value);
            $this->property_hashes[$name] = $hashed_value;
        }
    }