标签:restrict iter 比较 就是 builder 结束 less get time
传入一个开始时间(beginDate)以及结束时间(endDate)与某个时间(someTime)进行比较:restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.greaterThanOrEqualTo(root.<Date> get("someTime"), beginDate));
restrictions = criteriaBuilder.and(restrictions, criteriaBuilder.lessThanOrEqualTo(root.<Date> get("someTime"), endDate));
其实就是两个方法不一样:大于用greaterThanOrEqualTo(...)和小于用lessThanOrEqualTo(...)
标签:restrict iter 比较 就是 builder 结束 less get time
原文地址:http://blog.51cto.com/19951995/2067272