public function hydrateEntity(EntityInterface $entity, array $values)
    {
        foreach ($values as $value) {
            if (!$this->_toolbox->propertyExists($entity, $value['property_name'])) {
                $entity->set($value['property_name'], $value['value']);
                $entity->dirty($value['property_name'], false);
            }
        }

        // force cache-columns to be of the proper type as they might be NULL if
        // entity has not been updated yet.
        if ($this->config('cacheMap')) {
            foreach ($this->config('cacheMap') as $column => $fields) {
                if ($this->_toolbox->propertyExists($entity, $column) && !($entity->get($column) instanceof Entity)) {
                    $entity->set($column, new Entity);
                }
            }
        }

        return $entity;
    }