title: NotNull not working, Column(nullable = false) working
body: <p>I have a Spring Entity with a field annotated with @NotNull from javax.validation.constraints</p>
  
  <pre><code>@Entity
  public abstract class IdentifiableNamedEntity {
      @NotNull
      @Column(unique = true)
      private String name;
  }
  </code></pre>
  
  <p>The issue is that if a set a null value for the name field, it gets stored in the database. However, if I change the class as follow, it raises the exception I would like to receive:</p>
  
  <pre><code>@Entity
  public abstract class IdentifiableNamedEntity {
      @Column(unique = true, nullable=false)
      private String name;
  }
  </code></pre>
  
  <p>Is there a way I can avoid to specify nullable=false, but getting @NotNull to behave as I would like? Is there any alternative to nullable=false that relies on standard Java annotations, e.g. some Hibernate configuration?</p>
  
  <p>This is my spring configuration:</p>
  
  <p><strong>ApplicationContext</strong></p>
  
  <pre><code>&lt;beans ...&gt;
  &lt;context:property-placeholder location="classpath*:spring/database.properties" /&gt;
  &lt;context:component-scan base-package="com.lh.clte" /&gt;
  &lt;import resource="classpath:spring/applicationContext-persistence.xml" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>applicationContext-persistence</strong></p>
  
  <pre><code>&lt;beans ...&gt;
  &lt;import resource="classpath:spring/applicationContext-jpa.xml" /&gt;
  
  &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
      destroy-method="close"&gt;
      &lt;property name="driverClassName" value="${database.driverClassName}" /&gt;
      &lt;property name="url" value="${database.url}" /&gt;
      &lt;property name="username" value="${database.username}" /&gt;
      &lt;property name="password" value="${database.password}" /&gt;
      &lt;property name="initialSize" value="3" /&gt;
      &lt;property name="maxActive" value="10" /&gt;
  &lt;/bean&gt;
  
  &lt;tx:annotation-driven mode="proxy"
      transaction-manager="transactionManager" /&gt;
  &lt;bean class="org.springframework.orm.jpa.JpaTransactionManager"
      id="transactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
      id="entityManagerFactory"&gt;
      &lt;property name="persistenceUnitName" value="persistenceUnit" /&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>applicationContext-jpa</strong></p>
  
  <pre><code>&lt;beans ...&gt;
  &lt;jpa:repositories base-package="com.lh.clte.repository" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Since I am using repositories, I also report the corrisponding <strong>entity repository</strong>:</p>
  
  <pre><code>@Repository
  public interface IdentifiableNamedEntityRepository extends JpaSpecificationExecutor&lt;IdentifiableNamedEntity&gt;, JpaRepository&lt;IdentifiableNamedEntity, Long&gt; {
  }
  </code></pre>