title: Symfony5.4: Assert not null for property of entity not working
body: <p>I have a project where in the entity classes with</p>
  <ul>
  <li>@Assert\NotNull(
  <ul>
  <li>payload={&quot;severity&quot;=&quot;error&quot;},</li>
  <li>message=&quot;field not be empty&quot;</li>
  <li>)</li>
  </ul>
  </li>
  </ul>
  <p>the validation of mandatory field takes place.</p>
  <p>However, the above validation only works if the affected field is set to nullable=true. Which makes the field in the DB table as null=true.</p>
  <p>If I set null=false for the field with Doctrine, the @Assert\NotNull() function will not works.</p>
  <p>Is that correct that null=true has to be setted in order for the validation to work.</p>
  <p>BTW I don't find this approach coherent</p>