title: Null Version fields in JPA?
body: <p>Nothing in <a href="http://docs.oracle.com/javaee/6/api/javax/persistence/Version.html" rel="nofollow">http://docs.oracle.com/javaee/6/api/javax/persistence/Version.html</a> says it <em>cannot</em> be null. </p>
  
  <p>After running</p>
  
  <pre><code>import javax.validation.Validation;
  import javax.validation.Validator;
  
  import org.junit.Test;
  
  import static org.junit.Assert.assertFalse;
  
  public class Test
  {
      @Test
      public void test()
      {
          //Using Hibernate Validator 4.1.0.Final...
          Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
          assertFalse(validator.validate(new Foo()).isEmpty()); //why does this fail??
      }
  }
  </code></pre>
  
  <p>where Foo.class is simply</p>
  
  <pre><code>import javax.persistence.Entity;
  import javax.persistence.Version;
  
  @Entity 
  public class Foo
  {
      @Version
      private final Integer version = null;
  }
  </code></pre>
  
  <p>the test fails and no @Version validation errors are reported.</p>
  
  <p>So does this mean @Version-annotated fields can be null?</p>