title: Validation rules from entity mapping metadata
body: <p>Can someone, please, give me some enlightenment about how Symfony2 uses the ORM metadata to automatically build validation rules? I'm using Symfony2.1.</p>
  
  <p>For example, if we have a <code>Foo</code> entity with a required <code>name</code> attribute, we have the following Doctrine metada (as annotation):</p>
  
  <pre><code>@ORM\Column(name="name", type="string", length=255, nullable=false)
  </code></pre>
  
  <p>But then we have to repeat the <code>nullable</code> information with <code>Assert</code> if we want it to be validated in the server side:</p>
  
  <pre><code>@Assert\NotBlank()
  </code></pre>
  
  <p>In the other side, if we have a <code>number</code> attribute with an <code>integer</code> type, this is automatically used as a validation rule without the need of using any <code>@Assert</code> annotation.</p>
  
  <pre><code>@ORM\Column(name="number", type="integer", nullable=true)
  //@Assert\Type(type="integer") is no needed
  </code></pre>