title: Symfony2 + Doctrine Cross Db Relationships
body: <p>I have 2 entity managers with two different connections. There are 2 different dataabases.
  In short I have one database that keeps all my user credentials with FosUser and then each application gets this database to authenticate user. So one db for authentication centralized for all apps.</p>
  
  <p>The problem is that I need iduser as FK in an entity of my application 
  Imagine have an entity photo:</p>
  
  <p>then somewhere need to do this:</p>
  
  <pre><code>/**
   * @var integer
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  private $id;
  
  /**
   * @var integer
   *
   * @ORM\OneToOne(targetEntity="Foo\UserBundle\Entity\User")
   * @Orm\JoinColumn(name="iduser", referencedColumnName=".id")
   */
   private $user;
  </code></pre>
  
  <p>When I do doctrine:schema:update I get this error:</p>
  
  <p>[Doctrine\Common\Persistence\Mapping\MappingException]<br>
    The class 'Foo\UserBundle\Entity\User' was not found in the chain confi<br>
    gured namespaces Foo\FrontEndBundle\Entity     </p>
  
  <p>So whats the best practice to define cross db relationships with doctrine and Symfony2?</p>
  
  <p>Thanks a lot.</p>