Compare Date entities in JPA Criteria API
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<MessageSendInfo> criteriaQuery = criteriaBuilder.createQuery(Person.class);
Root<Person> root = criteriaQuery.from(Person.class);
criteriaQuery.select(root);
Predicate restrictions = criteriaBuilder.conjunction();
// date conditon >= 當前時間
restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.greaterThanOrEqualTo(root.<Date>get("sendDate"), new Date()));
reference
Compare Date entities in JPA Criteria API
JPA find entities where date is between start and end date that can be null using Criteria