1
0
mirror of synced 2024-12-13 22:56:04 +03:00

[DDC-551] Add filters to eagerly joined entities in the persisters

This commit is contained in:
Alexander 2011-10-26 16:11:27 +02:00
parent 07ce4092cd
commit 9ccce8ed74

View File

@ -1020,10 +1020,17 @@ class BasicEntityPersister
$this->_selectJoinSql .= ' AND ';
}
$tableAlias = $this->_getSQLTableAlias($assoc['targetEntity'], $assocAlias);
$this->_selectJoinSql .= $this->_getSQLTableAlias($assoc['sourceEntity']) . '.' . $sourceCol . ' = '
. $this->_getSQLTableAlias($assoc['targetEntity'], $assocAlias) . '.' . $targetCol . ' ';
. $tableAlias . '.' . $targetCol . ' ';
$first = false;
}
// Add filter SQL
if('' !== $filterSql = $this->generateFilterConditionSQL($eagerEntity, $tableAlias)) {
$this->_selectJoinSql .= ' AND ' . $filterSql;
}
} else {
$eagerEntity = $this->_em->getClassMetadata($assoc['targetEntity']);
$owningAssoc = $eagerEntity->getAssociationMapping($assoc['mappedBy']);