public function getEntityContextCacheKey(string $id, EntityDefinition $definition, Context $context, ?Criteria $criteria = null): string
    {
        $keys = [$this->getDefinitionCacheKey($definition), $id, $this->getContextHash($context)];

        if ($criteria && \count($criteria->getAssociations()) > 0) {
            $keys[] = md5(json_encode($criteria->getAssociations()));
        }

        return md5(implode('-', $keys));
    }