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