LocalDate between using JPA 2.1 Criteria API
In my entity I have two fields : private LocalDate startDate = LocalDate.of(1900, 1, 1); private LocalDate endDate = LocalDate.of(3000, 1, 1); Using JPA Criteria API I want to select entities where LocalDate.now() > startDate and LocalDate.now() < endDate . I tried as following : predicates.add(builder.greaterThan(LocalDate.now(), path.<LocalDate> get(Entity_.startDate))); predicates.add(builder.lessThan(builder.currentDate(), path.<LocalDate> get(Entity_.endDate))); But I get this error : The method greaterThan(Expression<? extends Y>, Expression<? extends Y>) in the type CriteriaBuilder is