title: Joining tables in Symfony2/Doctrine using entties
body: <p>I'm trying to add relationships to my database using the annotation method in my User Entity and Role Entity classes, however when I update the meta data and run an update from the command line and then go to phpMyAdmin there are no relationships present using the designer tool. I'm trying to write all database changes using Symfony2 and Doctrine to keep it consistent. Here is what I currently have:</p>
  
  <pre><code>&lt;?php
  
  namespace XXX\XXXBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
  * Role
  *
  * @ORM\Table(name="role")
  * @ORM\Entity
  * @ORM\HasLifecycleCallbacks()
  */
  class Role
  { 
  
   /**
   *
   * @ORM\OneToMany(targetEntity="User", mappedBy="role")
   */
  private $users; 
  
  }
  
  &lt;?php
  
  namespace XXX\XXXBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
  * User
  *
  * @ORM\Table(name="user",indexes={@ORM\Index(name="role", columns={"role_id"})})
  * @ORM\Entity
  * @ORM\HasLifecycleCallbacks()
  */
  class User
  { 
  
  /**
   * @var integer
   *
   * @ORM\Column(name="role_id", type="integer")
   * @ORM\ManyToOne(targetEntity="Role", inversedBy="users")
   * @ORM\JoinColumn(name="role_id", referencedColumnName="id")
   */
  private $role;
  
  } 
  </code></pre>