title: Hibernate + Spring: Conditional on create bean validation
body: <p>I use the date validaton using the <a href="http://docs.oracle.com/javaee/6/api/javax/validation/constraints/Future.html" rel="nofollow noreferrer">@Future</a> annotation. </p>
  
  <pre><code>@NotNull
  @DateTimeFormat(pattern="yyyy-MM-dd")
  @Column(name = "FROM")
  @Temporal(TemporalType.DATE)
  @Future
  private Date from;
  
  @NotNull
  @Column(name = "FOO")
  private String foo;
  </code></pre>
  
  <p>I perform CRUD operations using Rest API. The requirement is the <code>from</code> date will be in future - after the entity is being created (today). However, the time changes and in case of changing the field <code>foo</code> using ex. PUT method, the validation won't pass.</p>
  
  <pre><code>@PutMapping(value = "/{id}")
  public ResponseEntity&lt;?&gt; put(
      @Valid @RequestBody MyEntity myEntity, 
      @PathVariable("id") int id) 
  {
      ... update entity based on id
  }
  </code></pre>
  
  <p>When I call this method in the far future (after the <code>from</code> value persisted), the validation doesn't let me perform the operation, because the field <code>from</code> is no more valid.</p>
  
  <p>There is a simple in-built solution to trigger a certain validation only on create event? </p>
  
  <p>I have been thinking over creating the own cross-field validation through annotation, however I am not able to determine the creation based on other fields.</p>