title: ORM Doctrine - JoinTable and JoinColumn "column not found" or "could not resolve type of the column"
body: <p>I am a begginer in Doctrine and i am stuck in kind of a loop trying to establish a join table between 2 entities.</p>
  <p>I have a relation OneToMany between a &quot;train&quot; and &quot;containers&quot; and ManyToOne between &quot;containers&quot; and &quot;train&quot; obviously.</p>
  <p>I placed annotations on the OneToMany relation like this :</p>
  <pre class="lang-php prettyprint-override"><code>@ORM\Entity/Train
  
  @ORM\OneToMany(targetEntity=Container::class, mappedBy=&quot;Train&quot;)
  @ORM\JoinTable(name=&quot;train_container&quot;, 
  @ORM\joinColumns={@JoinColumn(name=&quot;id_tm&quot;, referencedColumnName=&quot;id_tm&quot;, nullable=false)},
  @ORM\inverseJoinColumns={@JoinColumn(name=&quot;id_container&quot;, referencedColumnName=&quot;id_container&quot;, nullable=false)})
        )
      
  private $Container;
  </code></pre>
  <p>and on the ManyToOne i did like this :</p>
  <pre class="lang-php prettyprint-override"><code>@ORM\Entity/Container 
  
  @ORM\ManyToOne(targetEntity=Train::class, inversedBy=&quot;Containers&quot;)
  @ORM\JoinColumn(name=&quot;id_tm&quot;, referencedColumnName=&quot;id_tm&quot;)
  private $Train;
  </code></pre>
  <p>Now, if i let it like that, i have an error saying :</p>
  <blockquote>
  <p>Annotation @ORM\joinColumns is not allowed to be declared on property App\Entity\Train::$container. You may only use this annotation on these code elements: PROPERTY.</p>
  </blockquote>
  <p>If i remove the joinColumn and just put this :</p>
  <pre class="lang-php prettyprint-override"><code>@ORM\ManyToOne(targetEntity=Train::class, inversedBy=&quot;Container&quot;)
  private $Train;
  </code></pre>
  <p>I have this error :</p>
  <blockquote>
  <p>Could not resolve type of column &quot;id&quot; of class &quot;App\Entity\Train&quot;</p>
  </blockquote>
  <p>I have no idea why its displaying an &quot;id&quot; column because the name of the column and the property on &quot;Train&quot; is always &quot;id_tm&quot; everywhere.</p>
  <p>Could anyone tell me what i am doing wrong please ?</p>
  <p>thanks a lot in advance
  M</p>
  <p>edit to add the code on the id's properties :</p>
  <pre class="lang-php prettyprint-override"><code>@ORM\Id
  @ORM\GeneratedValue
  @ORM\Column(type=&quot;integer&quot;, name=&quot;id_container&quot;)
  
  private $id_container;
  </code></pre>
  <pre class="lang-php prettyprint-override"><code>@ORM\Id
  @ORM\GeneratedValue
  @ORM\Column(type=&quot;integer&quot;, name=&quot;id_train&quot;)
  
  private $id_train;
  </code></pre>