public function getAdapter()
    {
        if (null == $this->adapter) {
            $className = $this->getEntityDescriptor()->className();
            $repository = Orm::getRepository($className);
            $this->setAdapter($repository->getAdapter());
        }
        return $this->adapter;
    }