Milan Brankovic
1 min readJul 27, 2020

--

hi abhishek kumar! You can write the specification in the following way:
return (Specification<ProtocolEntry>) (root, criteriaQuery, criteriaBuilder) ->
criteriaBuilder.lessThan(root.get(attribute), date);

Of course you need to check if date is not null before. Also you can use greaterThan if you want to search for date after. With those two you can combine specifications and create inBetween specification

--

--

No responses yet