I want to use CASE statement as Predicate in Criteria API.
Predicate isUpdateNotNull = criteriaBuilder.isNotNull(employee.get("updateDate"));
criteriaBuilder.selectCase().when(isUpdateNotNull, root.get("updateDate")).otherwise(root.get("createdDate"));
The selectCase() is returing Expression, not Predicate. How to make it as Predicate.
The output of your expression is a (date) value. To use it as a predicate (WHERE clause in SQL) you somewhat have to create a boolean output (e.g. .isNotNull()).