title: UniqueEntity doesn't work
body: <p>@UniqueEntity doesn't work for me. In controller I use $form->isValid() and form passes, but it shouldn't. Instead my own defined message, I got MySQL error:</p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'media30' for key 'UNIQ_115E494BF47645AE'</p>
  </blockquote>
  
  <p>I have following forms:</p>
  
  <pre><code>    class BIPType extends AbstractType{
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder-&gt;add('name');
          $builder-&gt;add('url');
      }
  
      public function getDefaultOptions(array $options)
      {
          return array(
              'data_class' =&gt; 'AppBundle\Entity\Bip',
          );
      }
  }
  </code></pre>
  
  <p>and next, overwritten FOSUser UserType form for registration which include BIPType:</p>
  
  <pre><code>class UserType extends AbstractType{
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $biptype = new BIPType();
          $builder
              -&gt;add('bip', $biptype, array(
              'data_class'=&gt;'AppBundle\Entity\Bip'))
              -&gt;add('nazwisko')
              -&gt;add('imie')
              ;
      }
  
      public function getParent()
      {
          return 'FOS\UserBundle\Form\Type\RegistrationFormType';
          // Or for Symfony &lt; 2.8
          // return 'fos_user_registration';
      }
  
      public function getBlockPrefix()
      {
          return 'app_user_registration';
      }
  
      // For Symfony 2.x
      public function getName()
      {
          return $this-&gt;getBlockPrefix();
      }
  }
  </code></pre>
  
  <p>and BIP entity</p>
  
  <pre><code>    use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  
  
  /**
   * @ORM\Entity
   * @UniqueEntity(fields="url", message="URL is already in use")
   * @ORM\Table(name="bips")
   */
  class Bip
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
      /**
       * @ORM\Column(name="url", type="string", unique=true)
       */
      protected $url;
  
      /**
       * @ORM\Column(type="string")
       * @Assert\Length(
       *      min = "3",
       *      max = "25",
       *      minMessage = "Nazwa BIPu musi mieć conajmniej 3 znaki.",
       *      maxMessage = "Nazwa BIPu może mieć conajwyżej 25 znaki."
       *)
       */
      protected $name;
  
  
      /**
       * @Assert\Image(
       *     minWidth = 80,
       *     maxWidth = 200,
       *     minHeight = 80,
       *     maxHeight = 200
       * )
       */
      protected $file;
  
      /**
       * Sets file.
       *
       * @param UploadedFile $file
       */
      private $temp;
  
      /**
       * @ORM\Column(type="string", length=255, nullable=true)
       */
      protected $path;
  
      /**
       * @ORM\Column(type="boolean", nullable=false)
       */
      private $public;
  </code></pre>