protected void addFromToMatch( BooleanBuilder builder, StoredQueryParam fromParam, StoredQueryParam toParam, NumberPath<Long> subselectJoinPk, String slotName) { String from = fromParam == null ? null : XDSUtil.normalizeDTM(fromParam.getStringValue(), false); String to = toParam == null ? null : XDSUtil.normalizeDTM(toParam.getStringValue(), true); if (from != null || to != null) { Predicate fromTo = from == null ? QSlot.slot.value.loe(to) : to != null ? ExpressionUtils.allOf(QSlot.slot.value.goe(from), QSlot.slot.value.loe(to)) : QSlot.slot.value.goe(from); builder.and( new JPASubQuery() .from(QSlot.slot) .where(QSlot.slot.parent.pk.eq(subselectJoinPk), QSlot.slot.name.eq(slotName), fromTo) .exists()); } }