private function createRepository($entityClass)
    {
        $repository = new EntityRepository();
        $repository->setAdapter(
            $this->adapters->get($this->getAdapterAlias($entityClass))
        )
            ->setEntityMapper($this->getMapperFor($entityClass))
            ->setEntityDescriptor(
                EntityDescriptorRegistry::getInstance()
                    ->getDescriptorFor($entityClass)
            );
        $this->repositories->set($entityClass, $repository);
        return $repository;
    }