title: Doctrine requires mappedBy in a OneToMany unidirectional association
body: <p>When I try to make a OneToMany unidirectional association between this two entities i get this error when i try to update the database schema:</p>
  
  <blockquote>
    <p>$ app/console doctrine:schema:update --dump-sql</p>
    
    <p>[Doctrine\ORM\Mapping\MappingException]<br>
    OneToMany mapping on field 'address' requires the 'mappedBy'
    attribute.</p>
  </blockquote>
  
  <pre><code>/**
   * User
   *
   * @ORM\Table()
   * @ORM\Entity
   */
  class User
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @ORM\OneToMany(targetEntity="Address")
       * @ORM\JoinTable(name="users_address",
       *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
       *      inverseJoinColumns={@ORM\JoinColumn(name="address_id", referencedColumnName="id", unique=true)}
       *      )
       */
      private $address;
  
      //...
  }
  
  /**
   * Address
   *
   * @ORM\Table()
   * @ORM\Entity
   */
  class Address
  {
      /**
       * @var integer
       *
       * @ORM\Column(name="id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      // ...
  }
  </code></pre>
  
  <p>Why is "mappedBy" required if the association is unidirectional?
  Thanks in advance.</p>
  
  <p><strong>UPDATE:</strong> just as mentioned in the comment by @tchap an unidirectional OneToMany can be mapped with a @ManyToMany and a unique constraint on one of the join columns to enforce the onetomany cardinality. Just as the documentation says, but it was a bit confusing for me because there is already a @OneToMay annotation. So I just have to change the above code to this (by only changing the @OneToMany to @ManyToMany):</p>
  
  <pre><code>/**
   * @ORM\ManyToMany(targetEntity="Address")
   * @ORM\JoinTable(name="users_address",
   *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
   *      inverseJoinColumns={@ORM\JoinColumn(name="address_id", referencedColumnName="id", unique=true)}
   * )
   */
  private $address;
  </code></pre>