/**
  * {@inheritdoc}
  */
 protected function getLockTablesSql($lockMode)
 {
     $joinSql = '';
     $identifierColumns = $this->class->getIdentifierColumnNames();
     $baseTableAlias = $this->getSQLTableAlias($this->class->name);
     // INNER JOIN parent tables
     foreach ($this->class->parentClasses as $parentClassName) {
         $conditions = array();
         $tableAlias = $this->getSQLTableAlias($parentClassName);
         $parentClass = $this->em->getClassMetadata($parentClassName);
         $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON ';
         foreach ($identifierColumns as $idColumn) {
             $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn;
         }
         $joinSql .= implode(' AND ', $conditions);
     }
     return parent::getLockTablesSql($lockMode) . $joinSql;
 }
 /**
  * {@inheritdoc}
  */
 protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias)
 {
     // Ensure that the filters are applied to the root entity of the inheritance tree
     $targetEntity = $this->em->getClassMetadata($targetEntity->rootEntityName);
     // we don't care about the $targetTableAlias, in a STI there is only one table.
     return parent::generateFilterConditionSQL($targetEntity, $targetTableAlias);
 }