CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery cQuery = builder.createQuery();
Root<AcsTemplateDateJPA> root = cQuery.from(AcsTemplateDateJPA.class);
ParameterExpression<Date> d = builder.parameter(Date.class);
cQuery.where(builder.between(d, root.<Date>get("inservicedate"), root.<Date>get("outservicedate")));
Query query = em.createQuery(cQuery.select(root.get("acstemplateid"))).setParameter(d, planDate, TemporalType.DATE);
List results =query.getResultList();
这里 outService 日期可以为空(结束在未来无限期)我如何添加这个条件?
谢谢,