Date comparison using the JPA criteria API
问题 I got a range date picker with two dates: start and end , where both can be empty. I would like to filter a table, where the entity has exact one date: date . So, here are some examples. I'd like to match. Imaging the date to match is the current date (17/07/2016). null - 17/07/2016 -> match 17/07/2016 - null -> match 17/07/2016 - 17/07/2016 -> match null - null -> match all Those are the edge cases in my opinion and the reason why I am struggling so much. Actually my code looks like: