/** * Creates a specification used to find LineStop whose arrival time is not null. * * @return a predicate */ public static Specification<LineStop> arrivalTimeIsNotNull() { return (root, query, builder) -> root.get(LineStop_.arrivalTime).get(TimestampDelay_.expected).isNotNull(); }
/** * Creates a specification used to find LineStop whose departure delay is not null. * * @return a predicate */ public static Specification<LineStop> departureDelayIsNotNull() { return (root, query, builder) -> root.get(LineStop_.departureTime).get(TimestampDelay_.delay).isNotNull(); }
/** * Creates a specification used to find LineStop whose arrival delay is not null. * * @return a predicate */ public static Specification<LineStop> arrivalDelayIsNotNull() { return (root, query, builder) -> root.get(LineStop_.arrivalTime).get(TimestampDelay_.delay).isNotNull(); }
/** * Creates a specification used to find LineStop whose departure time is not null. * * @return a predicate */ public static Specification<LineStop> departureTimeIsNotNull() { return (root, query, builder) -> root.get(LineStop_.departureTime).get(TimestampDelay_.expected).isNotNull(); }
@Override public Specification<SalesAchievement> specification() { return (root, query, cb) -> { Predicate predicate = cb.isTrue(root.get(SalesAchievement_.picked)); if (date != null) { predicate = cb.and(predicate, JpaFunctionUtils.dateEqual(cb , root.get(SalesAchievement_.targetTime), date)); } if (remark != null) { final Path<String> remarkPath = root.get(SalesAchievement_.remark); predicate = cb.and(predicate, !remark ? remarkPath.isNull() : remarkPath.isNotNull()); } if (deal != null) { Join<?, MainOrder> orderPath = root.join(SalesAchievement_.mainOrder, JoinType.LEFT); Predicate next; if (deal) next = cb.and(orderPath.isNotNull(), MainOrder.getOrderPaySuccess(orderPath, cb)); else next = cb.or(orderPath.isNull(), MainOrder.getOrderPaySuccess(orderPath, cb).not()); predicate = cb.and(predicate, next); } return predicate; }; } };