Php 为什么Doctrine2对findAll()进行内部联接?

Php 为什么Doctrine2对findAll()进行内部联接?,php,mysql,doctrine-orm,doctrine,inner-join,Php,Mysql,Doctrine Orm,Doctrine,Inner Join,我有一个用户和公司实体。每个用户都属于一家公司。以下是我的实体(简称): 我意识到,内部连接是我没有获得任何用户的原因。现在我很好奇是什么原因导致条令使用内部连接?是由于用户实体中的company属性的nullable=false,还是其他原因 <?php namespace App\Model\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; /**

我有一个
用户
公司
实体。每个
用户
都属于一家
公司
。以下是我的实体(简称):

我意识到,
内部连接是我没有获得任何用户的原因。现在我很好奇是什么原因导致条令使用
内部连接
?是由于用户实体中的company属性的
nullable=false
,还是其他原因

<?php

namespace App\Model\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**  
 * @ORM\Table(name="user")
 */
class User
{
    /** 
     * @ORM\Id
     * @ORM\Column(type="integer", name="user_id")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(length=200)
     */
    private $email;

    /**
     * @ORM\ManyToOne(targetEntity="Company", inversedBy="users", fetch="EAGER")
     * @ORM\JoinColumn(name="company_id", referencedColumnName="company_id", nullable=false)
     */
    private $company;

    // And a bunch of getters/setters

<?php

namespace App\Model\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/** 
 * @ORM\Table(name="company")
 */
class Company
{
    /** 
     * @var int
     *
     * @ORM\Id
     * @ORM\Column(type="integer", name="company_id", options={"unsigned":1})
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(length=100, unique=true)
     */
    private $name = "";

    /**
     * @var Doctrine\Common\Collections\ArrayCollection
     *
     * @ORM\OneToMany(targetEntity="User", mappedBy="company", cascade={"persist", "remove"}, fetch="LAZY")
     */
    private $users;

    // getters/setters
SELECT 
    t0.user_id AS user_id1, 
    t0.email AS email2, 
    t0.company_id AS company_id3, 
    t10.company_id AS company_id5, 
    t10.name AS name6 FROM user t0 
INNER JOIN company t10 
ON t0.company_id = t10.company_id