Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fee1good/7b59a2c49eb8fa3c720f2fa535496b03 to your computer and use it in GitHub Desktop.
Save fee1good/7b59a2c49eb8fa3c720f2fa535496b03 to your computer and use it in GitHub Desktop.
private <T extends EDoc<T>> Specification<T> findByPaymentDocumentNumber(String payDocNum) {
log.debug("findByPaymentDocumentNumber() - start: payDocNum = {}", payDocNum);
Specification<T> result = null;
if (StringUtils.isNotEmpty(payDocNum)) {
result = (root, query, criteriaBuilder) ->
criteriaBuilder.like(root.join("requestDocumentAttachmentList").get("paymentNumber"), "%" + payDocNum + "%");
}
log.debug("findByPaymentDocumentNumber() - end");
return result;
}
private <T extends EDoc<T>> Specification<T> findByPaymentDocumentDateTo(Date payDocDateTo, Integer offset) {
log.debug("findByPaymentDocumentDateTo() - start: payDocDateTo = {}, offset = {}", payDocDateTo, offset);
Specification<T> result = null;
if (payDocDateTo != null) {
final Date date = addDays(addMinutes(payDocDateTo, offset), 1);
result = (root, query, criteriaBuilder) -> criteriaBuilder.lessThanOrEqualTo(
root.join("requestDocumentAttachmentList").get("paymentDate"), date);
}
log.debug("findByPaymentDocumentDateTo() - end");
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment