title: Criteria Query Equal Date
body: <p>Could someone help me, i'm trying create a query to recovery all entries with some date... everything works fine except as i try:</p>
  
  <pre><code>criteriaQuery.select(root).where(builder.equal(root.get("dadosBoleto").get("dataVencimento").as(Date.class), new Date()));
  </code></pre>
  
  <p>or</p>
  
  <pre><code>criteriaQuery.select(root).where(builder.equal(root.get("dadosBoleto").&lt;Date&gt;get("dataVencimento"), new Date()));
  </code></pre>
  
  <p>When i execute this statement i haven't any data even existing the this criteria.</p>
  
  <p>My entity with dataVencimento</p>
  
  <pre><code>@Temporal(TemporalType.DATE)
  @Column(name = "data_vencimento", nullable = false)
  @NotNull(message = "Data inválida")
  private Date dataVencimento;
  //getters and setters
  </code></pre>