private function translateNamespaces(Query\ResultSetMapping $rsm)
    {
        $translate = function ($alias) {
            return $this->_em->getClassMetadata($alias)->getName();
        };

        $rsm->aliasMap = array_map($translate, $rsm->aliasMap);
        $rsm->declaringClasses = array_map($translate, $rsm->declaringClasses);
    }