title: embed one form into another symfony2
body: <p>I have two entity forms called 'Orders' and 'Address'. I want to embed Address form into orders form. Both entities are having relation by user column.</p>
  
  <p><strong>Address Entity</strong> </p>
  
  <pre><code>class Address
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @ORM\Column(type="string", length=128)
       */
      protected $type;    
  
      /**
       * @ORM\ManyToOne(targetEntity="Root\UserBundle\Entity\User", inversedBy="address")
       * @ORM\JoinColumn(name="user", referencedColumnName="id")
       * @ORM\ManyToOne(targetEntity="Orders", inversedBy="address")
       * @ORM\JoinColumn(name="user", referencedColumnName="user")
       */     
      protected $user;       
  </code></pre>
  
  <p><strong>Orders Entity</strong></p>
  
  <pre><code>class Orders
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @ORM\Column(type="string", length=128)
       */
      protected $status;    
  
      /**
       * @ORM\ManyToOne(targetEntity="Root\UserBundle\Entity\User", inversedBy="orders")
       * @ORM\JoinColumn(name="user", referencedColumnName="id")
       * @ORM\OneToMany(targetEntity="Address", mappedBy="orders")
       * @ORM\JoinColumn(name="user", referencedColumnName="user")
       */     
      protected $user;     
  </code></pre>
  
  <p><strong>Orders Form</strong></p>
  
  <pre><code>namespace Root\ContestBundle\Form\Front;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  use Root\ContestBundle\Entity\Address;
  use Root\ContestBundle\Form\Front\AddressType;
  class OrdersType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder-&gt;add('address', 'collection', array('type' =&gt; new AddressType()));
          $builder
          -&gt;add('termsAccepted');
  
      }
  </code></pre>
  
  <p>But I am getting error like below</p>
  
  <pre><code>An exception has been thrown during the rendering of a template ("Neither property "address" nor method "getAddress()" nor method "isAddress()" exists in class "Root\ContestBundle\Entity\Orders"") 
  </code></pre>
  
  <p>So what mistake I have made in my code. Help me out</p>