public function lock($document, $lockMode)
    {
        $qb          = $this->dm->createQueryBuilder($this->class->name);
        $identifier  = $this->uow->getDocumentIdentifier($document);
        $lockMapping = $this->class->lockMetadata;

        $qb->update();
        $qb->setIdentifier($identifier);

        $qb->attr($lockMapping->name)->set($lockMode);
        $qb->getQuery()->execute();

        $lockMapping->setValue($document, $lockMode);
    }