title: Automatically build a form using entity (one to one relationship)
body: <p>I'm wondering if it is possible to build a form using an entity to get all the fields, in a one-to-one relationship. To clarify:</p>
  
  <p>I have an <code>User.php</code> entity (with all the obvious fields, name, surname, genre, etc) and a <code>Address.php</code> entity. What I want is to build the whole form without adding one by one the properties of Address entity and save it with the proper relationship in the database.</p>
  
  <p>This is what I've tried (i've trimed the code a little bit), but obviously is not the correct way:</p>
  
  <p>User entity:</p>
  
  <pre><code>class User implements UserInterface {
  
  /**
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  
  
  /**
   * @ORM\Column(type="string", length=100, nullable=TRUE)
   */
  protected $firstName;
  
  /**
   * @ORM\Column(type="string", length=200)
   * @Assert\NotBlank()
   */
  protected $lastNames;
  
  /**
   * @ORM\OneToOne(targetEntity="Capsa\Bundle\ClubCommonBundle\Entity\Address")
   */
  protected $address;
  </code></pre>
  
  <p>Address class</p>
  
  <pre><code>class Address {
  
  /**
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  
  /**
   * @ORM\Column(type="string", length=100, unique=TRUE)
   * @Assert\NotBlank()
   */
  protected $streetName;
  
  /**
   * @ORM\Column(type="string", length=50)
   */
  protected $streetNumber;
  </code></pre>
  
  <p>Form builder:</p>
  
  <pre><code>public function buildForm(FormBuilder $builder, array $options) {
      $builder-&gt;add('login', 'text')
              -&gt;add('password', 'password')
              -&gt;add('firstName', 'text', array("required" =&gt; FALSE))
              -&gt;add('lastNames', 'text')
              -&gt;add('address', 'entity', array(
                  'class' =&gt; 'CapsaClubCommonBundle:Address',
                  'property'=&gt;'streetName'
              ));
  }
  </code></pre>
  
  <p>That only gets the field streetName of the table and puts it in a list.</p>