我有实体:
class RegionalPartner
{
/**
* @var integer
*
* @ORM\Column(name="direction_id", type="integer")
* @ORM\OneToOne(targetEntity="Direction")
* @ORM\JoinColumn(name="direction_id", referencedColumnName="id")
*/
private $directionId;
...
以及关系的目标:
class Direction
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
.....
我有一个存储库:
class RegionalPartnerRepository extends EntityRepository
{
public function findAllWithNames()
{
$query = $this->getEntityManager()
->createQuery('
SELECT
r
FROM
AstRegionalPartnerBundle:RegionalPartner r
JOIN
r.directionId d
');
//->setParameters($params);
return $query->getResult();
有一个错误:
[Semantical Error] line 0, col 108 near 'd': Error: Class Ast\RegionalPartnerBundle\Entity\RegionalPartner has no association named directionId
我应该怎么做才能制作正确的关系代码(需要将“方向”的名称获取到“RegionalPartner”实体)?
该 ORM 中连接的文档在哪里?